Hello,
I have a hot question (for me it is).
Im building an CU for a word intergration in NAV2009, in the CU i use the Microsoft Word 12.0 Object Library automation control to perform several actions.
One of the things i want to achieve is to fill mergefields in header and footer sections.
To achieve this i need to know how many mergefields are used in this sections, the code to read the sections is clear to me and works.
But there is one thing what doesnt work, and that is the count function.
I only get the result of the first line in the header section of the document, example.
--WORD DOC
--HEADER
<<mergefield1>> <<mergefield2>>
<<mergefield3>>
--HEADER
If i do the following, MergeFieldCount := WordApp.Selection.Fields.Count;
The result is 2, so only the first line in the header section is counted.
Does anyone knows al solution for this ?? I searched the inet for a long time now but no answers.
0
Comments
Pargesoft
Pargesoft
But thnx for the reply.
I changed the iunit paramter from 5 to 6, and now the count delivers a good result.
WordApp.Selection.EndKey(iUnit,iExtend);
greetzzz