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!

vba to save bound ole object - word automation 1

Status
Not open for further replies.

Pampers

Technical User
Apr 7, 2004
1,300
AN
Hi everyone,
I'm trying to do some word automation through vba. Here is what it does so far: create a new worddocument, add a template to it, save the new document with a unique name (number) on the hard disk. So far so good.

Now I want this document to be saved - linked - in an bound ole object which is on my form. How can I do that with vba??

Pampers [afro]
Just let it go...
 
That is great VicRauch!
I even got the code working, although I have to have a look again (tomorrow) what exactly is happening. Here is the code I used.

Code:
With Me.frmContactLetterSub0.Form.[Letter]
.Enabled = True
.Locked = False
' Specify what kind of object can appear in the field.
.OLETypeAllowed = acOLELinked
' Specify the file to be linked.
.SourceDoc = "C:\My Files\Peters files\" & strFileName & ".doc"
' Create the linked object.
.Action = acOLECreateLink
End With
Tnx a lot, and a star of course.

Pampers [afro]
Just let it go...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top