Welcome Serena Central users! CLICK HERE
The migration of the Serena Central community is currently underway. Be sure to read THIS MESSAGE to get your new login set up to access your account.
rlilly Contributor.

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")

   RETURNING bkExist.

IF bkExist = 1

   MODIFY wrdDoc @GoTo(BY NAME @What wdGoToBookmark BY NAME @Name "CompanyName")

   RETURNING wrdRange

   IF wrdRange NOT = 0

      MODIFY wrdRange @InsertAfter(BY NAME @Text my-text-field)

      DESTROY wrdRange


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.


1 Reply
Micro Focus Expert
Micro Focus Expert

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.

The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.