Using Automation (Navision --> Word97/Word2000)

I have a problem with automation. I have done the following: declared the variables: wdApp: “Microsoft Word 8.0 Object Libary”.Application wdRange: “Microsoft Word 8.0 Object Libary”.Range wdFind: “Microsoft Word 8.0 Object Libary”.Find When this code is runned: CREATE(wdApp); wdRange := wdApp.Selection.Range; wdRange.Text := ‘#’ + FeltKode + ‘#’; CLEAR(wdApp); the program stops at the line: wdRange := wdApp.Selection.Range; and the error message says: (translated from norwegian) This automation variable haven’t been startet yet. You can start it by creating or connect to it. What is wrong? Kenneth Dybvik Programmer Aston Naviteam Norway AS

First of all you’ll have to make a document first. Declare a variable as word document. Then you’ll have to tell word what document you’re working on(a new one, or first open one). After that you can select a range in the document. You can not select a range when you didn’t open a document. If you don’t know how to make such a document, just let me know (you can e-mail me if you want).