Solved

How can you update information on task in MSProject?

Posted on 2002-03-26
7
197 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 44

Expert Comment

by:bruintje
Comment Utility
if they only had a spelling checker in this system
0
 

Author Comment

by:aharafa
Comment Utility
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
Comment Utility
Thank you, if i can help in anything please tell me ..

aharafa
0
 
LVL 44

Expert Comment

by:bruintje
Comment Utility
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Recently Microsoft released a brand new function called CONCAT. It's supposed to replace its predecessor CONCATENATE. But how does it work? And what's new? In this article, we take a closer look at all of this - we even included an exercise file for…
My experience with Windows 10 over a one year period and suggestions for smooth operation
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…

772 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

8 Experts available now in Live!

Get 1:1 Help Now