Skip to main content

Problem:

How to change the settings for MS Word document's orientation, margins, and font

Resolution:

There are few demo projects in Net Express, which shows how to use Microsoft Word with Cobol applications, and they are located in C:\\Program Files\\Micro Focus\\Net Express 4.0\\Base\\DEMO\\COMDEMOS\\WORD. The programs may not show you how to change the settings you wish to change, but they show you how to change MS Word settings in general. You can have a look at MSWORD.CPY in the same folder to discover other numerous methods to change MS Word's settings or properties. We do not provide any documentation on how to use MS Word from Cobol. You need to know Object-Oriented Cobol and methods and functions available in MS Word.

The attached demo (WORD3.CBL) is taken from the Word demo folder and modified to set orientation, margins, and font.

Go to the Microsoft MSDN site (http://msdn.microsoft.com) to see the complete documentation on these MS Word functions, methods, and properties.

Attachments:

WORD3.zip

Old KB# 3960