Solved

How can you update information on task in MSProject?

Posted on 2002-03-26
7
200 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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

820 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