Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MS Project Automation
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00358711
Message ID:
00359766
Views:
13
Thanks Michael,

This is a great start to get me going. Is there any resource you know of that will give me a complete list of all MS Projects properties and methods?

>>Anyone done any automation of MS Project? If so, could you please steer me in the right direction for getting started. i.e. the correct parameters for CREATEOBJECT(), any help files or docs, how to add items, etc. TIA
>
>Colin:
>Here is a little code that we use:
>
>***********************************************************************8
>WAIT WINDOW "Now Creating CPM Template for " + ALLT(vSelectedproject.cProjectname) + " - Please Stand By" NOWAIT NOCLEAR
>
>SELECT 0
>USE pas!vroofactv
>
>lcDirectory = ALLT(vselectedproject.cDirectory)
>
>lcFileName = ALLT(SUBSTR(lcDirectory,RAT("\",lcDirectory) + 1,7)) + "r.mpp"
>
>lcOutputfile = lcDirectory + "\" + STR(gnProgramyear,4) + "\schedule\" + lcFilename
>goMsproject = CREATEOBJECT("MSPROJECT.APPLICATION")
>goMsproject.Application.Visible = .T.
>goMsproject.FileOpen(gcRoofingMPPFile)
>
>goMSProject.ActiveProject.CustomDocumentProperties.Add("File Source",.F.,4,"Roofing Contractor")
>goMSProject.ActiveProject.CustomDocumentProperties.Add("Project Name",.F.,4,vSelectedProject.cProjectname)
>goMSProject.ActiveProject.CustomDocumentProperties.Add("Project Number",.F.,1,vSelectedProject.nProject)
>
>goMsproject.SetTaskField("Name",ALLT(vselectedproject.cProjectname) + " - " + ALLT(vselectedproject.cDivision))
>
>llFirst = .T.
>SELECT vroofactv
>SCAN
> goMsproject.SelectTaskField(1,"Name")
> goMsproject.SetTaskField("Name",ALLT(vroofactv.cItemletter) + " " + vroofactv.cDescription)
> goMsproject.SetTaskField("Cost",vroofactv.nAwardamount)
> IF llFirst
> goMsproject.OutlineIndent
> llFirst = .F.
> ENDIF
>ENDSCAN
>goMsproject.ActiveProject.ProjectStart = DTOC(vSelectedProject.dRoofingNTP)
>
>goMsproject.FileSaveAs(lcOutputFile)
>
>goMsproject.Application.Quit
>
>WAIT CLEAR
>lcMessage = lcOutputFile + " has been created"
>=MESSAGEBOX(lcMessage,64,"CPM Template created")
>
>RETURN
>
>
>HTH,
>Mike Collins
Colin Magee
Team Leader, Systems Development
Metroland Media Group Ltd.
Mississauga, Ontario, Canada

cmagee@metroland.com

Never mistake having a career with having a life.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform