We have some simple software, which can parse some texts into word template. This parsing may be used for example to produce an invoice programmatically.
Actually we need to parse some WORD FIELDs into WORD template. We can easily insert some strings into Word document as for example:
{INCLUDETEXT "[login to view URL]"} but then WORD will not recognize it as a FIELD. This string will remain as plain text in WORD.
What is interesting if I copy some files from one WORD docment into another one then in the new document the parsed text is recognised as FIELD.
Maybe then this depends of the contents of string, which is copied into WORD document? If yes then the task would be just saying to me how to construct text string so after placing it into WORD the string will be recognised as FIELD.
If this is impossible then we would be interested in another option described bellow.
Let say I can automatically parse some texts (strings) into WORD document and then I can save it automatically (as RTF file type).
I need to have a macro, which will always run automatically when the RTF type document is opened and which will find all strings in document as for example:
{INCLUDETEXT "[login to view URL]"} and will change them to FIELDS (having the same content as these strings).
As in the standard WORD(RTF) document there maybe some other texts in brackets ({...} which are not intedned to be FIELDs therefore I suggest that the text to be replaced will be in two pairs of bracket as:
{{INCLUDETEXT "[login to view URL]"}}. So in other words if a macro will find in document any strings type {{....}}. Then it should change it to FIELD.
I have tried to do it manually and it works. So Let say that MACRO is finding a string {{......}}. If then such string is marked in block then after pressing key Ctl-F9 the text will be converted by WORD into FIELD. Not we need only to remove unwanted brackets from it.
Finally MACRO should display the entire document so instead of Fields there is a right text visible. This is done also by some F9 key combination.
Please note that the document we save can be saved only as RTF file type. This however is not a problem becasue after RTF document opernign it behaves exactly as normal WORD document.
I was student in the best state university in Indonesia. I am a quick learner and a hard worker. integrity and consumer satisfaction is priority. I hope you choose me to help you. I will prove to you that I will not make you disappointed