Solved

How can you update information on task in MSProject?

Posted on 2002-03-26
7
198 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
  • 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 100 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Have you ever had the experience that you had to follow 10 steps over and over again every time when you need to nicely forward an important email to your manager? Fear no more! With the help of the Quick Steps feature in Outlook 2010, your old chor…
No matter the version of Windows you are using, you may have some problems with Windows Search running too slow or possibly not running at all. Before jumping into how you can solve this issue, just know there are many other viable alternative deskt…
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …
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…

867 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now