Insert subdocument into master (vc++)

J

John Rodgers

I am attempting to insert a new subdocument into a master document using
automation. However, every attempt at calling the SubDocuments
AddFromFile method fails with a 0x800a11fd. Before calling it, I get
the windows for the document (of which there is only 1) and get its pane
- I set the pane's view type to be wdOutlineView. I then locate one of
the existing subdocs and get its range. I collapse that range to the
start. Is there something I am missing?

thanks,
John
 
C

Cindy M -WordMVP-

Hi John,
I am attempting to insert a new subdocument into a master document using
automation. However, every attempt at calling the SubDocuments
AddFromFile method fails with a 0x800a11fd. Before calling it, I get
the windows for the document (of which there is only 1) and get its pane
- I set the pane's view type to be wdOutlineView. I then locate one of
the existing subdocs and get its range. I collapse that range to the
start. Is there something I am missing?
I'd try getting the entire document range, then collapse that range to the
end. Inserting a subdocument generates two section breaks in the Master
document. These section breaks are what make Master Documents quite
unstable, and one has to be VERY careful with them. Most likely, you're
trying to insert a sub-document in a place where the Word document can't
(isn't meant to) handle it.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 

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