ViewType

ViewOptions.ViewType property

控制 Microsoft Word 中的查看模式。

public ViewType ViewType { get; set; }

评论

尽管 Aspose.Words 能够读取和写入此选项,但其用法是特定于应用程序的。 例如,MS Word 2013 不尊重此选项的值。

例子

演示如何设置自定义缩放系数,旧版本的 Microsoft Word 将在加载时应用于文档。

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.Writeln("Hello world!");

doc.ViewOptions.ViewType = ViewType.PageLayout;
doc.ViewOptions.ZoomPercent = 50;

Assert.AreEqual(ZoomType.Custom, doc.ViewOptions.ZoomType);
Assert.AreEqual(ZoomType.None, doc.ViewOptions.ZoomType);

doc.Save(ArtifactsDir + "ViewOptions.SetZoomPercentage.doc");

也可以看看