Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Importing Word document into a form VB6

Status
Not open for further replies.

yvlUser

Technical User
Jun 20, 2004
7
0
0
BE
Hello,
I'am seeking to import a whole Word document to show it into a document on a form. Reference marked [Microsoft Word 10.0 object librarie] and Component Insertable object [Microsoft Word document] are marked. So, I can place a [document] that's available in the toolbox. How can I get the text from a word document into that [document] on a form? I can open word as getobject etc., add, open and show the desired document in the word object. I just want to import it into the [document] on my form. Any suggestions please?
 
Use the Object Frame controls. You can basically store anything in there. Also, investigate the Ole Object field type if you want to store the object.
 
Hello comaboy,
Frame controls are used to provide an identifiable grouping for other controls. For example, you can use frame controls to subdivide a form functionally. That's not what I need. I just want to know how to paste a Word document into a document object on a form. The properties available with the Word object doesn't allow this. Do you have an examplecode? Thanks anyway
 
He's not talking about the Frame Control; he means the OLE Container control
 
Thank you both, I linked the document to the ole-object displayed as a help-icon.
 
1. Stick the Ole control onto your form, sized as you wish. It'll prompt with a dialog box for you to choose the type of object to embed or link. Click the 'Cancel' button, which leaves you with an empty Ole Container.

2. Want to load your own Word document into the container?

OLE1.CreateEmbed "MyDocument.doc"

(more completely should be
OLE1.CreateEmbed "MyDocument.doc", "word.document"
but since .doc is - or should be - associated with Word, the short version works fine)

3. All done

Want to automate the embedded document? See my code (and CCLINT's minor update) in thread222-564289 (the example there assumes that you embedded a document at design time, but can easily be modified to deal with embedding at runtime)

 
Thanks strongm,
It's also an other solution for the problem I had.
Problem is solved now.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top