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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Word OLEObject button

Status
Not open for further replies.

Tyfos

Technical User
Sep 24, 2000
5
DK
Can anyone plz help me ASAP?
I've got this form with a OLE-Object field. Normally you right-click and chose "Insert Object" then Word doc. What I want is a button that does the same, and ofcourse imbed it into the Table field of the record.
Then I also need a button to open the document later when nessesary...

Can anyone help?..Thankz... [sig][/sig]
 
Tyfos,

The simlest way ...

Im assuming you have a bound OLE frame on your form called "OLEbound1".

On your form create a command button with the wizzard turned off.

Open the properties sheet for the button. Use the ... button to create a macro for the On Click event of the button. The macro will include the following actions:

Action Argument

GoToControl OLEbound1
RunCommand InsertObject

In the properties for the OLE frame you want the following properties set:

Enabled: Yes
Locked: No
Auto Activate: DoubleClick

You probably want to set the display type, update options and OLE Type Allowed properties also.

You may want to link rather than embed. Just food for thought, in either case the solution is the same. But remember, embedding a file will place file data dirrectly in your database. Linking to a file will go out and look at the file wherever it resides. If the files will be deleted, you need to embed them. If the files stay on the network or local drive you may want to link them. You need to decide based on your application.

If you set the properties as above, to open the document in word, you should just have to double click the OLE frame.

You can also accomplish the same as above in VBA using the acolecreatelink or oleinsertobjdialog(Youll need to double check that in help).

If you really need a button to open the doc as opposed to double clicking.

For further info and possible ideas, check the on line help regarding the PLE object properties such as "verb".

Hope this helps. [sig]<p>Dave<br><a href=mailto:gallagherd@earthlink.net>gallagherd@earthlink.net</a><br>[/sig]
 
Incomplete sentence (My Inglush Teecher wood b prowd) ...

Should have read &quot;If you really need a button to open the doc as opposed to double clicking, the VBA is acoleactive. [sig]<p>Dave<br><a href=mailto:gallagherd@earthlink.net>gallagherd@earthlink.net</a><br>[/sig]
 
Tnxs....But I still have to choose Word document...Can't I make that automatic?

[sig][/sig]
 
Could you be more specific ?

Do you want access to scan a dirrectory and link all the files in the dirrectory or something like that ?

Im not sure what you are looking for. [sig]<p>Dave<br><a href=mailto:gallagherd@earthlink.net>gallagherd@earthlink.net</a><br>[/sig]
 
The first reply you postet was almost perfect. Just what I needed..but if I could get it to automatic choose a Word Document, instead I have to choose it manually from all the &quot;Objects&quot;.
I want it to jump over the &quot;screen&quot; where you choose &quot;Object(Word, Excel etc.) and directly to the Word document.

Can U Help? [sig][/sig]
 
If you set the OLE type allowed property to linked, the dialog box that apears should contain a browse button only (without the create new / from file or object type selections). This will prompt the user to browse and select the file to be linked.

[sig]<p>Dave<br><a href=mailto:gallagherd@earthlink.net>gallagherd@earthlink.net</a><br>[/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top