>Hi
>
>I am developing a fairly simple Word Merge link for an application using SQL7 as a back end.
>I need to merge a few specific data fields from SQL7 to a Word document, preferably instantiated from a Word template. I am using Word 97.
>I cannot use VBA embedded in Word since the main 'driving' application needs to pass the information (RecordID) about which piece of data to use via a command line parameter, which will not work with hosted VBA.
>So I am using a VB6 exe to query a directory and produce a list of available Word templates in that directory.
>On choosing a template and clicking the Merge button I need to launch Word and create a new document based on this template. It is here I am having problems, how can I launch Word? The MSDN documentation says: "If you are automating Word from some other application, you must create a Word Application object variable and then create an instance of Word."
>If someone can help me decode that sentence I'd appreciate it.
>
>Martin Selway
Set a reference to Word and add this code:
Dim oWord as Word.Application
Set oWord = New Word.Application