insert a blank OLE Word doc in a table using VBA

A

Alex Sandifer

In Access 97, is there any way to use VBA code to insert a
new blank OLE Word doc in a table WITHOUT linking the
document to a bound object frame on a form? The user does
not need to see or interact with the document at this
stage, so I want all this to be going on behind the
scenes. Thanks in advance.

Alex
 
R

Rod Scoullar

Alex,

Why not just store the path to the document. If you want to open it later
you can use Automation.

Rod.
 
G

Guest

Rod,

Thanks for the suggestion, but this is a database for a
client, and they require Word documents as embedded (not
linked) OLE documents in an Access database.

Alex
 
Joined
May 30, 2016
Messages
1
Reaction score
0
Here's some code, and you need to set the objects Class to "Word.Document"

Private Sub btnEditDoc_Click()

Dim Word_Obj As Object

If IsNull(Me.ScreenShotsAndDoc) Then
Me!ScreenShotsAndDoc.Action = acOLECreateEmbed
Else
Me!ScreenShotsAndDoc.Verb = -2
Me!ScreenShotsAndDoc.Action = 7
Set Word_Obj = ScreenShotsAndDoc.Object.Application.wordbasic
Word_Obj.ViewNormal
End If

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top