Word 2013 Automation
I have coding to automate Microsoft Word documents. We set up Word documents and bookmark specific fields and then my program opens the document and fills in the appropriate bookmarked information.
This works in older versions of Word, Word 2007, and Word 2010. In Word 2013, it pulls up the document, but does not fill in the fields. Debugging shows that the C$EXCEPINFO is giving 06124 in the ERROR-INFO-CODE and I have no idea what this means.
MODIFY wrdBookmarks @Exists (BY NAME @Name "CompanyName")
IF bkExist = 1
MODIFY wrdDoc @GoTo(BY NAME @What wdGoToBookmark BY NAME @Name "CompanyName")
IF wrdRange NOT = 0
MODIFY wrdRange @InsertAfter(BY NAME @Text my-text-field)
It generates the error on the MODIFY wrdRange @InsertAfter... line.
It successfully completes the other line, which find the book and the position in the document of the bookmark, but it fails to insert the data.
As I said, it works successfully except in Word 2013. I was using an older word.def file (trying to keep our programming backwards compatible) and I did create a word15.def file using the msword.olb for Office 2013, thinking perhaps the new definition might do the trick, but no such luck.
Thanks in advance for any help.
RE: Word 2013 Automation
I would do a compare of your word15.def file against the ones for Word 2007 / 2010 to see if the @InsertAfter is in the same place, has the same parent, takes the same parameters. If so, please contact Customer Care and submit this as an issue.