ViewOptions Class
Provides various options that control how a document is shown in Microsoft Word.
Inheritance Hierarchy

Namespace: Aspose.Words.Settings
Assembly: Aspose.Words (in Aspose.Words.dll) Version: 20.1
public class ViewOptions

The ViewOptions type exposes the following members.

Public propertyCode exampleDisplayBackgroundShape
Controls display of the background shape in print layout view.
Public propertyCode exampleDoNotDisplayPageBoundaries
Turns off display of the space between the top of the text and the top edge of the page.
Public propertyCode exampleFormsDesign
Specifies whether the document is in forms design mode.
Public propertyCode exampleViewType
Controls the view mode in Microsoft Word.
Public propertyCode exampleZoomPercent
Gets or sets the percentage (between 10 and 500) at which you want to view your document.
Public propertyCode exampleZoomType
Gets or sets a zoom value based on the size of the window.
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodToString (Inherited from Object.)
Shows how to make sure the document is displayed at 50% zoom when opened in Microsoft Word.
Document doc = new Document(MyDir + "Document.doc");

// We can set the zoom factor to a percentage
doc.ViewOptions.ViewType = ViewType.PageLayout;
doc.ViewOptions.ZoomPercent = 50;

// Or we can set the ZoomType to a different value to avoid using percentages 
Assert.AreEqual(ZoomType.None, doc.ViewOptions.ZoomType);

doc.Save(ArtifactsDir + "ViewOptions.SetZoom.doc");
See Also