Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Lauching Word from VB exe.
Message
From
16/12/2000 17:07:27
 
General information
Forum:
Visual Basic
Category:
Other
Miscellaneous
Thread ID:
00454374
Message ID:
00454422
Views:
24
>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
Guy Barrette, MCSD
============
Blog http://weblogs.asp.net/guybarrette
Microsoft Regional Director, Montreal, Canada www.microsoft.com/rd
MVP, ASP.NET http://mvp.support.microsoft.com/
President, Montreal Visual Studio User Group www.guvsm.net
INETA Regional Rep for Quebec www.ineta.org
UniversalThread Magazine Columnist (.NET Books Review Column) www.utmag.com
Tech Chair French Track, DevTeach 2004 & 2005 www.devteach.com
Business Architect, Microsoft Team - Nurun Inc www.nurun.com
XBox Live Gamer Tag: Slomo QC CA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform