to open .mpp file in my vc++ application

G

Gaurav

Hi,
I want to create an application in VC++ through which I want to read MS
Project .mpp file and to show their properties according to my application
and also want to print the various views like resource view, Gantt view etc.
So please reply me is it feasible to create such application in VC++, if yes
then from where can I get the MS Project API.
Please reply me your precious views.
Thanks in Advance.

Regards,
Gaurav
 
R

Rod Gill

HI,

Looks like you need to use Office automation to open a copy of project then
display appropriate views etc. Strongly suggest you do this in a VB module
as VB is significantly easier and quicker to code automation stuff with
Office apps than VC++. You can do it in VC++ but you will need twice the
time and lines of code (at least!).

For example with VB you can record macros in Project to do much of what you
want then copy paste the VBA macro code into VB and have it work with little
editing.
 
G

Gaurav

Hi Rod Gill,
Thanks for ur reply.
So I came to know tha solution should be made in VB.
Now can u do little more favour, can u give me a link of sample source code
that just describe how to extract features of office tool through VB, or u
just write a little sample code for me to explain ur point.
Thanks alot once again for ur reply.

Regards,
Gaurav
 
R

Rod Gill

Hi,

This should get you started:

Sub OpenProject()
Dim projApp As MSProject.Application
Dim Proj As MSProject.Project
Set projApp = CreateObject("MSProject.Application")
projApp.Visible = True
projApp.FileOpen "Full Path and file name"
Set Proj = ActiveProject

'Manipulate project here

'Close project
projApp.FileClose pjDoNotSave
Set projApp = Nothing
End Sub
 
C

Cory K. Walker

Another way is to use the Project 2003 OLE DB provider from your application.
Point the provider to your MPP file in the connection string and you'll be
able to read project information in tables.

See the Microsoft Office Project 2003 OLE DB Provider Reference.
 
S

Shyam

Hi all..

this code is great.. can any one help me out in getting the MPP Loaded in
the forms of my application instead of loading an New MS Project
Application.. since i dont want the user to save it to a local file. my
requriemnt is, i want to direclt save it to an DB. in stead of the file.. and
i want to open from a DB direcly..

Thanks in Advance..
 
R

Rod Gill

Record a macro in project to see how to open and save to your db. You can
then edit the code accordingly.
 

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