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

Insert Object by Code without using Insert Object Open Dialog Box 1

Status
Not open for further replies.

clivepot

Technical User
Jan 10, 2003
3
GB
I am trying to find a way by code to insert/embed a Word Document into a bound OLE field on a form rather than using the menu and the Insert Object Open Dialog Box.
Can anyone help?
 
You could try this behind a button:

Dim strOle As String
strOle = "c:\my documents\Test.doc" 'this can ref a control
Me!YourBoundOLEControlName.SetFocus
SendKeys "%f,%e" & strOle & "{ENTER}"
RunCommand acCmdInsertObject


There probably is a cleaner way to do this, but for the life of me, I can't find it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top