Code Question

Peter Paul

Registered User.
Local time
Today, 18:35
Joined
Jan 1, 2000
Messages
82
I am trying to automate an OLE to open into a Word document. I am stealing the code from a book, but cannot get it to work.

The code is:

On Error GoTo AddTextErr
Comments.Class = "Word.Document"
Comments.OLETypeAllowed = acOLEEmbedded
Comments.Action = acOLECreateEmbed
Comments.Action = acOLEActivate
AddTextErr:
MsgBox Error$ Chr$(12) & "Unable to embed word document"
Resume AddText

AddText:

The first error I am getting is on Comments, states that the command is not recognized.

Any suggestions would be much appreciated,

Peter Paul
 
Comments is class module. You need to copy the code for this module otherwise you cannot use its functions. The code should be included in your book. Hope it works now.

Mitch
 

Users who are viewing this thread

Back
Top Bottom