Project Automation Using C++/MFC

M

MFC GUY

Can anyone point to documentation or code samples describing how one
delevelopes Automation code with MS Project (v2003 or any version) using C++
(and MFC).

There's plenty of doc in VB but I canot fond anything for C++.

Thanks
 
R

Rod Gill

Office automation is significantly easier and quicker to write in VB, hence
the focus on VB in documentation. I strongly recommend you use a VB module
for Office automation. You can of course use C++ for all remaining code.

VB typically does what you need with far fewer lines of code and the code VB
produces runs at exactly the same speed as c++ code as the performance
limiter is the inter-process communications with the Office app.

Biggest speed boost for coding in VB is you can create VBA macros that work
in Project and with minimal editing get them to work in vb. Alternatively,
code in VBA for Excel and copy that for even less editing!

VB has intellisense, named and optional parameters and one or two other
features that make coding and developing in VB significantly faster,
especially if you copy paste working VBA code first.

You can do it in C++ but my experience from this group over many years is
that few people do given VB's advantages in this form of programming. I've
also noticed that there is little or no response from C++ developers so I
can only assume very few developers use C++ for Office automation.
 
M

MFC GUY

Thanks for the reply.

I agree with everything you said. I also have done some Office automation
over the years and you're correct - VB is much, much easier than C++. If I
were to start from scratch, I would of course use VB or C#, etc.

I am, however, building an MS Project import/export feature in my existing
commercial application, which has 300,000+ lines of MFC/C++ code. I have a
working module in C++ which talks to the MS Project object model, just fine.
My problem is that the programming is slow going, because of the lack of
documentation and samples.

Is there anyone at Microsoft or elsewhere that has done this type of Office
automation?

Thanks very much for your consideration.
 

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