A problem with ole control

I’m just starting out with embeding controls into notes forms (so pointing me to any documentation would be nice).

I’m having a problem setting and retrieving values from a control. When I have lotus script debuging on, it works fine. But if I don’t have debuging turned on, I can’t access the properties.

Here’s a simple form that recreates the problem (this is not the control I’m using, but it should be one that everyone has):

  1. Create a new form

  2. Create a new object

  3. Select Control and then choose Microsoft Rich Textbox Control

  4. Change the name of the control to ole1

  5. Change (RunReadOnly) to True

  6. Change the Text property to “TEST”

  7. In the form’s Postopen put the following code

Sub Postopen(Source As Notesuidocument)

Dim ole1 As Variant

Set ole1 = source.GetObject("ole1")

Msgbox ole1.Text

End Sub

  1. Turn on lotusscript debuging

  2. Preview the document (you should see a msgbox with “TEST” in it)

  3. Turn off lotusscript debuging

  4. Preview the document (you should see a blank msgbox)

Subject: Try this…

Sub Postopen(Source As Notesuidocument) Dim ole1 As Variant

Set ole1 = source.GetObject("ole1")

Call ole1.Activate

Msgbox ole1.Text

End Sub

Subject: RE: Try this…

That gives me an error message “Instance member ACTIVATE does not exist”

It looks like Activate is part of the EmbeddedObject or NotesEmbedObject classes. But I don’t know how I can get this object (the examples only show creating a new object).