jeza
asked on
Accessing OLE Objects
i have a database that stores templates (.doc, .xls .lwp ext) i create a ole objects from the templates. i can get the template, embed an ole object, open the object and pass field values to that ole object. but i can not get the object to FitToWindow when the document first opens.
i don't want the object to activate, i want the user to click on the object to activate it. how can i set the fittowindow property of the new object when creating the form?
the ui says there is an embedded object but will not update the properties.
i don't want the object to activate, i want the user to click on the object to activate it. how can i set the fittowindow property of the new object when creating the form?
the ui says there is an embedded object but will not update the properties.
ASKER
here is the code i have in the post open of the word document.
Sub Postopen(Source As Notesuidocument)
Dim s As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim view As NotesView
Dim object As NotesEmbeddedObject
Dim handle As Variant
Dim WordObj As Variant
'check if new document, if yes create new word doc, if not open from document
If source.IsNewDoc Then
'get the template document and extract the attachment to the hdd.
Set db = s.CurrentDatabase
Set view = db.GetView("Standard Templates")
Set templatedoc = view.GetDocumentByKey("Sta ndard Letter",True)
Set tmpobject = templatedoc.Getattachment( "letter.do c")
Call tmpobject.ExtractFile("c:\ temp\stand ardletter. doc")
'through the ui go to the body field and create the object.
Call source.gotoField( "Body" )
Call source.CreateObject("Lette r","","c:\ temp\stand ardletter. doc")
'setup a handle for the ole object.
Set WordObj = source.getObject("Letter")
'Populate variables with info to pass to word and update the variables in Word document
WordObj.variables("Formal" ).value = source.fieldGetText("Forma l")
WordObj.variables("Initial ").value = source.fieldGetText("Initi al")
WordObj.variables("FirstNa me").value = source.fieldGetText("First Name")
WordObj.variables("LastNam e").value = source.fieldGetText("LastN ame")
WordObj.variables("Company ").value = source.fieldGetText("Compa ny")
WordObj.variables("Address 1").value = source.fieldGetText("Addre ss1")
WordObj.variables("Address 2").value = source.fieldGetText("Addre ss2")
WordObj.variables("Address 3").value = source.fieldGetText("Addre ss3")
WordObj.variables("City"). value = source.fieldGetText("City" )
WordObj.variables("County" ).value = source.fieldGetText("Count y")
WordObj.variables("Country ").value = source.fieldGetText("Count ry")
WordObj.variables("PostCod e").value = source.fieldGetText("PostC ode")
WordObj.variables("Author" ).value = s.commonUserName
'Activate Word, add a window for the new document and show the application
WordObj.activate
WordObj.Fields.Update
Elseif source.Inpreviewpane = False Then
'Get object and activate Word.
Set WordObj = source.getObject( "Letter" )
WordObj.activate
End If
End Sub
Sub Postopen(Source As Notesuidocument)
Dim s As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim view As NotesView
Dim object As NotesEmbeddedObject
Dim handle As Variant
Dim WordObj As Variant
'check if new document, if yes create new word doc, if not open from document
If source.IsNewDoc Then
'get the template document and extract the attachment to the hdd.
Set db = s.CurrentDatabase
Set view = db.GetView("Standard Templates")
Set templatedoc = view.GetDocumentByKey("Sta
Set tmpobject = templatedoc.Getattachment(
Call tmpobject.ExtractFile("c:\
'through the ui go to the body field and create the object.
Call source.gotoField( "Body" )
Call source.CreateObject("Lette
'setup a handle for the ole object.
Set WordObj = source.getObject("Letter")
'Populate variables with info to pass to word and update the variables in Word document
WordObj.variables("Formal"
WordObj.variables("Initial
WordObj.variables("FirstNa
WordObj.variables("LastNam
WordObj.variables("Company
WordObj.variables("Address
WordObj.variables("Address
WordObj.variables("Address
WordObj.variables("City").
WordObj.variables("County"
WordObj.variables("Country
WordObj.variables("PostCod
WordObj.variables("Author"
'Activate Word, add a window for the new document and show the application
WordObj.activate
WordObj.Fields.Update
Elseif source.Inpreviewpane = False Then
'Get object and activate Word.
Set WordObj = source.getObject( "Letter" )
WordObj.activate
End If
End Sub
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.
I will leave the following recommendation for this question in the Cleanup topic area:
PAQ with points refunded
Any objections should be posted here in the next 4 days. After that time, the question will be closed.
Zvonko
EE Cleanup Volunteer
I will leave the following recommendation for this question in the Cleanup topic area:
PAQ with points refunded
Any objections should be posted here in the next 4 days. After that time, the question will be closed.
Zvonko
EE Cleanup Volunteer
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://www-10.lotus.com/ldd/today.nsf/62f62847467a8f78052568a80055b380/7d432c8317c276c8852566eb00695f28?OpenDocument
It would be also interesting to see the code you have so far for the OLE institution.