view_type property
ViewOptions.view_type property
Controls the view mode in Microsoft Word.
@property
def view_type(self) -> aspose.words.settings.ViewType:
...
@view_type.setter
def view_type(self, value: aspose.words.settings.ViewType):
...
Remarks
Although Aspose.Words is able to read and write this option, its usage is application-specific. For example MS Word 2013 does not respect the value of this option.
Examples
Shows how to set a custom zoom factor, which older versions of Microsoft Word will apply to a document upon loading.
doc = aw.Document()
builder = aw.DocumentBuilder(doc=doc)
builder.writeln('Hello world!')
doc.view_options.view_type = aw.settings.ViewType.PAGE_LAYOUT
doc.view_options.zoom_percent = 50
self.assertEqual(aw.settings.ZoomType.CUSTOM, doc.view_options.zoom_type)
self.assertEqual(aw.settings.ZoomType.NONE, doc.view_options.zoom_type)
doc.save(file_name=ARTIFACTS_DIR + 'ViewOptions.SetZoomPercentage.doc')
See Also
- module aspose.words.settings
- class ViewOptions