Quantcast
Channel: Microsoft Dynamics NAV Forum - Recent Threads
Viewing all articles
Browse latest Browse all 29197

RE: MS Word Automation Numered List

$
0
0

Thanks for your suggestion Nev.

Here I leave the code I used to solve my problem.

Thank you again.

CODE:

NewLine := 13;

Tab := 9;

CLEAR(WordApp);

IF ISCLEAR(WordApp) THEN

 CREATE(WordApp, TRUE, FALSE);

WordDoc           := WordApp.Documents.Add;  //Add New Document

WordAppSelection  := WordApp.Selection;

WordApp.Run('Macro1'); //Activate the numered list

WordAppSelection.TypeText('Text1');

WordAppSelection.TypeText(FORMAT(NewLine));

WordAppSelection.TypeText('Text2');

WordAppSelection.TypeText(FORMAT(NewLine));

WordAppSelection.TypeText('Text3');

WordAppSelection.TypeText(FORMAT(NewLine));

WordApp.Run('Macro2'); //Deactivate the numered list

WordAppSelection.TypeText(FORMAT(NewLine));

WordAppSelection.TypeText(FORMAT(NewLine));

WordAppSelection.TypeText(FORMAT(TAB));

WordAppSelection.TypeText('Texto3');


Viewing all articles
Browse latest Browse all 29197

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>