Retrieving page from C:\. using MS Word 2007

Joined
Mar 22, 2013
Messages
1
Reaction score
0
Hello

Using MS Word 2003 I was able to use Word automation to bring a Word
document into memory (a cover page) and then add additional word documents
(detail text pages) to it, in effect creating a "book".

The problem is that when I upgraded to MS Word 2007 the the cover page
doesn't show anymore but the other additional pages still show.

The error message says that the cover page of the document is null so
I know in MS Word 2007 it is working a little differently. Below is the code
that I am using trying to bring in the cover page:

oApplication = new Word.Application();
oApplication.Visible = true;

object opath2 = "C:\\MyPgm\\MyDocs\\wDoc1.docm";
oDocument = oApplication.Documents.Add(ref opath2 , ref oMissing, ref oMissing, ref oMissing);
oDocument.Activate();

In other words "oDocument" is null, when using MS 2007 but in MS 2003 it would contain the value
in "opath2" which is "C:\\MyPgm\\MyDocs\\wDoc1.docm".

What do I have to do to make oDocument contain the value in opath2 instead of null?

Thank you
Shabeaut
 

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