insert a blank OLE Word doc in a table using VBA

  • Thread starter Thread starter Alex Sandifer
  • Start date Start date
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
 
Alex,

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

Rod.
 
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
 
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
 
Back
Top