document.SaveAs changes to normal view

A

Andy Fish

Hi,

I am using OLE interop to save a word document as XML (from C#) - something
like:

doc = app.Documents..Open(...);
doc.SaveAs(...,WdSaveFormat.wdFormatXML, ...)

The original document is in page layout view, but the saved XML document is
in normal view.

This works fine (i.e. the view is preserved) when doing it interactively.
Any ideas please?

Andy
 
J

Jezebel

Documents aren't "in" any particular view ... it's the application itself
that determines the display. If you don't like the view, change it.
 
A

Andy Fish

Jezebel said:
Documents aren't "in" any particular view ... it's the application itself
that determines the display. If you don't like the view, change it.

Not true - if you save a document in page layout view with 150% zoom and
re-open it (even on a different PC) it will open up in page layout with 150%
zoom.

in WordMl you have

<w:docPr>
<w:view w:val="print"/>
<w:zoom w:percent="150"/>

as part of the document
 
J

Jezebel

Your question was about normal vs page layout. If you want to change the
topic and answer your own questions, why bother with a forum?
 
A

Andy Fish

sorry if there's been any confusion. Just to clarify

Background: When a word document is saved, the current view settings (which
mode and current zoom level) are saved as part of the document, and these
are used next time the document is opened.

Problem: When I operate word from C# using OLE and do a 'save as', the saved
document always has normal view and 100% zoom, not the settings of the
original document

is there any way to avoid this behaviour and retain the view settings of the
original document, as would happen if I did the 'save as' manually?
 
C

Cindy M -WordMVP-

Hi Andy,

No idea if you're still around or have gotten to the bottom of this problem?
sorry if there's been any confusion. Just to clarify

Background: When a word document is saved, the current view settings (which
mode and current zoom level) are saved as part of the document, and these
are used next time the document is opened.

Problem: When I operate word from C# using OLE and do a 'save as', the saved
document always has normal view and 100% zoom, not the settings of the
original document

is there any way to avoid this behaviour and retain the view settings of the
original document, as would happen if I did the 'save as' manually?

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