Solved

How can you update information on task in MSProject?

Posted on 2002-03-26
7
201 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 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
Increase your protection from Zero Day threats!

Running two Antivirus' is never a good idea.
Taking advantage of Multiple Security layers on the other hand can often save your hide.
See which top notch security software brands have been proven to happily coexist together.
Reduce your chances of becoming a statistic.

 
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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
This video walks the viewer through the process of creating envelopes and labels, with multiple names and addresses. Navigate to the “Start Mail Merge” button in the Mailings tab: Follow the step-by-step process until asked to find the address doc…
This video shows where to find the word count, how to display it, and what it breaks down to in Microsoft Word.

742 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