Word 2010 automation: 'goto bookmark'
问题 I have a program written in Delphi-7 which opens a new Word document which is based on a template. Once the document is open, the automation jumps to a bookmark (predefined in the template) and adds some text there. The following code works fine in Word 2003 but causes a invalid variant operation error message in Word 2010 (I have omitted try/except blocks for the sake of clarity) . wrdapp:= CreateOleObject ('Word.Application'); wrdDoc:= wrdapp.documents.add (wrdApp.Options.DefaultFilePath