Aspose::Words::Settings::ViewOptions::get_ViewType method
ViewOptions::get_ViewType method
Controls the view mode in Microsoft Word.
Aspose::Words::Settings::ViewType Aspose::Words::Settings::ViewOptions::get_ViewType() const
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.
auto doc = System::MakeObject<Aspose::Words::Document>();
auto builder = System::MakeObject<Aspose::Words::DocumentBuilder>(doc);
builder->Writeln(u"Hello world!");
doc->get_ViewOptions()->set_ViewType(Aspose::Words::Settings::ViewType::PageLayout);
doc->get_ViewOptions()->set_ZoomPercent(50);
ASSERT_EQ(Aspose::Words::Settings::ZoomType::Custom, doc->get_ViewOptions()->get_ZoomType());
ASSERT_EQ(Aspose::Words::Settings::ZoomType::None, doc->get_ViewOptions()->get_ZoomType());
doc->Save(get_ArtifactsDir() + u"ViewOptions.SetZoomPercentage.doc");
See Also
- Enum ViewType
- Class ViewOptions
- Namespace Aspose::Words::Settings
- Library Aspose.Words for C++