Link to home
Start Free TrialLog in
Avatar of NigelRocks
NigelRocks

asked on

Automation with VB6 and MS Word

Experts,

I'm attempting to embed MS Word in a VB6 form using the attached snippet.  It works, but it opens the Word document outside of the VB app.  How do I make it open up inside the app?
Dim oMSWord As Word.Application
    Dim oWordDoc As Word.Document
 
    Set oMSWord = CreateObject("Word.Application")
    oMSWord.Visible = True
    
    Set oWordDoc = oMSWord.Documents.Open("C:\Documents and Settings\Curt\My Documents\Work\6899 FORM.doc")

Open in new window

SOLUTION
Avatar of rachitkohli
rachitkohli
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of NigelRocks
NigelRocks

ASKER

I don't see Microsoft Word listed anywhere.  How do I bring it in?
rachitkohli,

From what I can see, I'll have to buy a third party .ocx to do this (and they're very expensive).

ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Actually, it turns out to not be quite what I'm looking for (but useful).  The only other control I've been able to add to my toolbox is Microsoft Word Document.  I haven't seen anything else.  For whatever reason, I haven't had any luck using it.  Maybe I need to just read up on that.