Access from Outlook to project tasks

  • Thread starter Michael Freitter
  • Start date
M

Michael Freitter

Greetings,

I have two questions:

(1)
I want to access from my VBA Code in Outlook 2007 to Project-file Version
2003. I want read the tasks from project with followed statement:

For Each T In ActiveProject.Tasks
......
Next T

How code must I have, so that I connect from Outlook to Project?

(2)
Can I access the task from a project-file via vba, if only outllook is
instaled and not project?

Thanks and regards
Michael
 
R

Rod Gill

Hi,

Add a reference to Project via Tools, References in the VBE then

dim projApp as MSProject.Application
on error resume next
set projApp=GetObject(,"MSProject.Application")
if projapp is nothing then
msgbox "Couldn't find an open project"
End
End If
For Each T In projApp.ActiveProject.Tasks
......
Next T
set projapp=nothing

You have to have Project installed on the same PC and the project you want
to work with open for this code to work.

--

Rod Gill
Microsoft MVP for Project

Author of the only book on Project VBA, see:
http://www.projectvbabook.com
 
M

Michael Freitter

Hi,

thank you!

There are any other way to using the tasks in an ms project file via VBA,
without the MS-Project software itself on the PC is installed?

Regards
Michael
 
R

Rod Gill

Sorry, no. You can however store projects in .mpd file format which is an
Access format then use oledb to read from the .mpd file using an Access
oledb driver.

--

Rod Gill
Microsoft MVP for Project

Author of the only book on Project VBA, see:
http://www.projectvbabook.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top