Help on Action property in VB to specify operation on an OLE object

Randix

Registered User.
Local time
Today, 18:43
Joined
Mar 24, 2001
Messages
56
I have a report written to a file using rtf. In VB, I want to insert a link to that file in my table which has a field for OLE objects. Can anyone give me help on the code for that task? I'm looking at the help topic for the Action Property, but it's not "clicking" for me...I'll be using Word to view it fwiw.

[This message has been edited by Randix (edited 05-31-2001).]
 
If you have a form with a button on it, you can put this code into the onclick procedure... oleVar is the name of the OLE field and FileName is the name of the file you want a link inserted to.

' Set class name.
Me("oleVar").Class = "rtf"

' Specify type of object.
Me("oleVar").OLETypeAllowed = acOLELinked

' Specify source file.
Me("oleVar").SourceDoc = FileName

'Create the Link
Me("oleVar").Action = acOLECreateLink

Hope this helps...

Doug
 
Thanks for the reply! After searching other posts here, I see some believe it's more efficient to not use an OLE object field, but just a text field, and shell to access the file reference in the text field, rather than linking to it...any opinions?
 

Users who are viewing this thread

Back
Top Bottom