Word automation: inserting text at bookmark?

Moin: Anybody out there who can give me a hint? I want to initiate a word document from NAVISION Financials 2.5. No problem to create a document and set the cursor to a certain position to a bookmark which is created in the template. WordDoc := WordDocs.Add ( TemplateName ); WordBookmarks := WordDoc.Bookmarks; s := ‘Name3’; WordBookmarks.Item ( s ).Select; s := ‘“aaaaaaaaaaaaaaaa”’; WordSelection.Text := s; WordApp.Visible := TRUE; Running this code, I get the error message that Wordselection is not instantiated. If I do a CREATE ( WordSelection ) before using Wordselection I get the error message that WordSelection could not get instantiated. Any ideas? Regards Uwe

I have not the slightest experience with Word automation but I would expect that the assignment should look something like: WordSelection := WordBookmarks.Item ( s ).Select; In your code WordSelection does not have any reference and simply doesnt have any assigned value. Second remark: You can only instanciate Applications. Not depending Objects. Marcus Marcus Fabian phone: +41 79 4397872 m.fabian@thenet.ch

Marcus: Thank you for your input. The line “WordSelection := WordBookmarks.Item ( s ).Select;” is rejected when compiling (This variable cannot be assigned). Regards Uwe