Hi people !
I'm using Word automations. I have to write some informations from Navision to a Word template wich is stored as a blob in the Interaction Template table. There are already some fields created in the Word template wich is structured as header and a footer.
How can I perform the following actions :
1. write a value from Navision to a field in the Word Document.
2. write additional texts between the header and the footer. This means that I have to know where the header ends and where the bottom starts in order to prevent replacing my existing fields.
What are the properties and/or methods to use ?
Any samples in VB are welcome.
NB : I have already search the forum. I found some topics those have already help me to perfom a lot of others actions, but I still need to know how to do for the 2 above and time is money ...
Thx in advance.
0
Comments
Tools -> Macros -> Record a new Macro.
Manually make all changes you want to do.
Stop Recording.
Check Macro Source Code. You will there the code in VBA that you convert to C/AL.
Freelance Dynamics AX
Blog : http://axnmaia.wordpress.com/
But I still face the first problem. How to write into a MergeField in a Word document from Navision using automation... ??
](*,)
Thanks.
Pargesoft
Is the 'Navision Attain ApplicationHandler'.MergeHandler' automation specific to the Service module and functionalities....? :-k
Anyway, I found another solution, this may not be the perfect solution, but it works :
-I declare a new automation variable (autWrdAp) of Subtype 'Microsoft Word 11.0 Object Library'.Document.
-To find a text and replace it by another text in a word template, I use the Execute method :
autWrdDoc.Content.Find.Execute(FindText,[some others parameters],ReplaceText)
[/quote]
Arhontis
https://forum.mibuso.com/search
If those parameters do not need to be changed, just declare two variables :
bParam : boolean
iParam : integer
then run the function as follow :
autWrdDoc.Content.Find.Execute(FindText,,bParam,bParam,bParam,bParam,bParam,bParam,iParam,bParam,ReplaceText);
For more informations about these others parameters, use the Record Macro functionality in Microsoft Word as explain by Nunomaia above.