954,582 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

VB6 MS Word

Ok, im having a long time creating reports for my program.

I would like to ask if it is possible to connect my program

to an existing msword file.

E.g:

If i click a button on my form, lets say cmdLeaveReport,

an msword file named leavereport.doc will open (of course in word window that is)

Is it possible, any example.?

Only a report, not connected to my Dbase at all.

abelingaw
Posting Whiz in Training
205 posts since Jun 2008
Reputation Points: 66
Solved Threads: 26
 

Yes it is possible.

You'll need to add a Reference to Microsoft Word Object Library (with the Tools, References menu)

Dim wrdApp As New Word.Application
wrdApp.Documents.Open "E:\My Documents\ReadMe.doc"
wrdApp.Visible = True
AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350
 

Thanks so much.

I'm lazy in creating reports, REALLY.

//SOLVED

abelingaw
Posting Whiz in Training
205 posts since Jun 2008
Reputation Points: 66
Solved Threads: 26
 

It's a pleasure. Happy coding.:)

:)I'm lazy in creating reports, REALLY:)

Trust me, you're not the only one....

AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You