Word Resize/Zoom problem?

C

Csabi

Hi,

I'm developing a C#.NET application which insertes data into Word.

When I open the Word-document(template), then I set it's Zoom to be
PageFitFullPage:

wordApp.WindowState = Word.WdWindowState.wdWindowStateNormal;
wordApp.ActiveWindow.ActivePane.View.Zoom.PageFit =
Word.WdPageFit.wdPageFitFullPage;

My problem is, that when I close the .NET application, then I leave Word to
be available too, I resize Word to be 80% width of the desktop, and 80%
height. After this, I set the PageFit, and Zoom properties:

wordApp.ActiveWindow.ActivePane.View.Zoom.PageFit =
Word.WdPageFit.wdPageFitNone;

wordApp.ActiveWindow.ActivePane.View.Zoom.Percentage = zoomPercentage;

The zoomPercentage value is 100, so I set the Zoom to be 100%.

My problem is, that on many documents, after closing the C# application, I
try to resize the Word app, and it still seems to be in PageFitFull mode,
because if I resize, the Zoom value changes (and also the full page is
visible in Word). If I manually enter 100% in the Zoom of Word, it will stay
100% when I resize.

The strange thing is, that on some other documents, if I ran this code, it
works properly! So if I resize the WordApp the Zoom stays on 100%!

I don't know what can be the difference between the 2 documents (they are
templates though), maybe anyone some advice, how to solve this problem?

Thanks,
Csabi
 

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