Example Code

Multiple Page Orientations in Word Document with the Report Generation Toolkit and ActiveX

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.


  • LabVIEW

Code and Documents



Coding that exemplifies how to change the orientation of a page in Word.



Some Microsoft Word documents can benefit from having different page orientations (portrait or landscape)
within a single document. Each section of a Word document can only have one orientation. In order for your document to
have multiple orientations, it is first necessary to create an additional section. The example below shows how to create
a new section and then change its orientation using ActiveX.



LabVIEW 2012 (or compatible)


Steps to Implement or Execute Code
1. Select a Word file
2. Run the VI.

Additional Information or References


Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.