To expand sub documents when activating a document

S

Sandeep

Hi,

I am opening a document from my c# code. The document
itself is containing two subdocuments. When I activate the
document to open it, it gets opened but the subdocuments
in it appear in hyperlind and not in expanded mode.
I have however explicitly stated the following code to
expand all subdocuments, but failed-

aDoc.ActiveWindow.ActivePane.View.Type =
Word.WdViewType.wdOutlineView;

WordApp.ActiveDocument.Subdocuments.Expanded = true;

Can anyone suggest whatz wrong with that.
How to get subdocuments expanded when opening the master
document.


Thx.
Sandeep
 
C

Cindy M -WordMVP-

Hi Sandeep,

Why do you use aDoc in the one line and
WordApp.ActiveDocument in the other? Stick to the document
object variable and avoid ActiveDocument (and Selection) like
the bubonic plague...
I am opening a document from my c# code. The document
itself is containing two subdocuments. When I activate the
document to open it, it gets opened but the subdocuments
in it appear in hyperlind and not in expanded mode.
I have however explicitly stated the following code to
expand all subdocuments, but failed-

aDoc.ActiveWindow.ActivePane.View.Type =
Word.WdViewType.wdOutlineView;

WordApp.ActiveDocument.Subdocuments.Expanded = true;

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep
30 2003)
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