Based on the documentation that references it , it is clear that Document provides PageSetup .
The PageSetup property has the PaperSize property, which allows you to determine the paper size of a document - a complete list of available paper sizes is specified in the WdPaperSize enum element (see here: http://msdn.microsoft.com/en-us/library/microsoft.office.interop. word.wdpapersize.aspx ).
So, to set the size of a document document, you can do something like this:
document.PageSetup.PaperSize = WdPaperSize.wdPaperA4;
To show how this can be done in a βfullβ context, I included a complete sample in the following. The sample is implemented as a C # console application using .NET 4.5, Microsoft Office Object Library version 15.0 and Microsoft Word Object Library version 15.0 (that is, object libraries that come with MS Office 2013).
using System; using Microsoft.Office.Interop.Word; using Application = Microsoft.Office.Interop.Word.Application; namespace WordDocStats { class Program { static void Main() {
source share