How to Use "ViewType" and "ZoomType" Enumeration


#1

Hi,



Can you tell me how to use View type and Zoom type enumeration and how they can applied to the document.


#2

With these properties you can control the starting view mode and zoom type for the document when it is opened in MS Word.

For example to set document to be opened in Normal mode choose ViewType.Normal:

Document doc = new Document();

doc.ViewOptions.ViewType = ViewType.Normal;

string filename = Application.StartupPath + @"\testViewOptions Out.doc";

doc.Save(filename);

// Open document in MS Word.

System.Diagnostics.Process.Start(filename);

Or to to set document to be opened in Print Layout mode choose ViewType.PageLayout:

Document doc = new Document();

doc.ViewOptions.ViewType = ViewType.PageLayout;

doc.ViewOptions.ZoomType = ZoomType.FullPage;

string filename = Application.StartupPath + @"\testViewOptions Out.doc";

doc.Save(filename);

// Open document in MS Word.

System.Diagnostics.Process.Start(filename);

Regards,