Set View Options in Word Documents
The following example shows how you can set a Word document view type and zoom with the GemBox.Document component.
using GemBox.Document;
class Program
{
static void Main()
{
// If using the Professional version, put your serial key below.
ComponentInfo.SetLicense("FREE-LIMITED-KEY");
var document = new DocumentModel();
document.Sections.Add(
new Section(document,
new Paragraph(document, " ")));
var viewOptions = document.ViewOptions;
viewOptions.ViewType = ViewType.Web;
viewOptions.Zoom = %Zoom%;
document.Save("View Options.%OutputFileType%");
}
}
Imports GemBox.Document
Module Program
Sub Main()
' If using the Professional version, put your serial key below.
ComponentInfo.SetLicense("FREE-LIMITED-KEY")
Dim document As New DocumentModel()
document.Sections.Add(
New Section(document,
New Paragraph(document, " ")))
Dim viewOptions = document.ViewOptions
viewOptions.ViewType = ViewType.Web
viewOptions.Zoom = %Zoom%
document.Save("View Options.%OutputFileType%")
End Sub
End Module
