?
Solved

How can you update information on task in MSProject?

Posted on 2002-03-26
7
Medium Priority
?
203 Views
Last Modified: 2010-08-05
Hi All

I want to ask about if there is a way through the Application object of MSProject to update on some information on certain task in certain project, not inserting i want modifying already existing task
if any one provide me with sample code i will appreciate that .

Thank you

aharafa
0
Comment
Question by:aharafa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 44

Expert Comment

by:bruintje
ID: 6897381
Hi aharafa,

Found something not a direct answer but this sample is showing how to change a piece of an Project file through code

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/PR2KSDK/html/automatemp2k.asp?frame=true

be sure to study the object model, pitty i got no project installed here

HTH:O)Bruintje
0
 

Author Comment

by:aharafa
ID: 6898585
Hi Bruintje

Really i read all the MSDN documantation on MSProject object model but there is no list of all properties and methods of the application object and no documentation on it even the samples of code exist only cover how to get data not how to modify existing data, and thats my problem
but thank you any way for help

aharafa
0
 
LVL 44

Accepted Solution

by:
bruintje earned 400 total points
ID: 6908174
Hi aharafa,

sorry for the delay but i finally to get my hands on a developer copy of Project so i could give you a sample

Dit this from Excel because i got no VB at home ;)

-first reference the ms project file into your project VB or other
-then paste the code below

Sub testProject()
Dim appProject As New MSProject.Application
Dim intTaskcount As Integer, i As Integer

appProject.FileOpen "E:\projects\prive\project_files\MOUS_MASTER.mpp"
With appProject.ActiveProject
  intTaskcount = .Tasks.Count
  For i = 1 To intTaskcount
    MsgBox .Tasks(i).Duration
    .Tasks(i).Duration = .Tasks(i).Duration - 1
    MsgBox .Tasks(i).Duration
  Next
End With
appProject.Quit pjDoNotSave
Set appProject = Nothing
End Sub

-first replace my filename + path for your own
-then step through the code and expecially the line

>>>>>.Tasks(i).Duration = .Tasks(i).Duration - 1

-you can whatever you want on that line .Tasks(i). gives you every property of the project currently open

HTH:O)Bruintje
0
Office 365 Training for IT Pros

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

 
LVL 44

Expert Comment

by:bruintje
ID: 6908175
if they only had a spelling checker in this system
0
 

Author Comment

by:aharafa
ID: 6908484
Dear bruintje

Thank you really for your help , really you are great, i don't know really if you are male or female , but whatever you are ....sure that you are great ...thank you, i hope i can help you in any thing .

aharafa

0
 

Author Comment

by:aharafa
ID: 6908488
Thank you, if i can help in anything please tell me ..

aharafa
0
 
LVL 44

Expert Comment

by:bruintje
ID: 6908532
Hi again, well i'm a male and i'm in here for the points so it is really my *duty* to come up with an answer to all these questions. That makes someone else happy, and me too :-)
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Cancel future meetings from user mailboxes in Office 365 using Remove-CalendarEvents
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question