Outlook 2003 bound textbox

D

Daniel

I have a bound textbox in the compose page and the read page. In my code I use customproperty to write to the textbox. I shows up in compose but it won't show up in read. Just to be sure I copied and paste the textbox in compose to read but with the same thing happening. The only thing I can think of is that there is something wrong with my code that is causing this but I don't know what. My code checks a set of bound checkboxes and adds a message to the subject textbox1.

Sub Item_CustomPropertyChange(ByVal Name)
set CheckAVG = Item.GetInspector.ModifiedFormPages.Item("Message").Controls( "CheckAVG")
set CheckMas200 = Item.GetInspector.ModifiedFormPages.Item("Message").Controls( "CheckMas200")
set CheckPopups = Item.GetInspector.ModifiedFormPages.Item("Message").Controls( "CheckPopups")
set CheckVirus_Trojans = Item.GetInspector.ModifiedFormPages.Item("Message").Controls( "CheckVirus_Trojans")
set CheckWindows = Item.GetInspector.ModifiedFormPages.Item("Message").Controls( "CheckWindows")
set CheckOther = Item.GetInspector.ModifiedFormPages.Item("Message").Controls( "CheckOther")
set TextOther = Item.GetInspector.ModifiedFormPages.Item("Message").Controls( "TextOther")
set TextBox1 = Item.GetInspector.ModifiedFormPages.Item("Message").Controls( "TextBox1")
Dim True1
Dim True2
Dim True3
Dim True4
Dim True5
Dim True6


Select Case Name
Case Name
If CheckAVG.Value = True Then
True1 = " AVG"
Else
True1 = ""
End If

If CheckMas200.value = True Then
True2 = " MAS200"
Else
True2 = ""
End If

If CheckPopups.Value = True Then
True3 = " Unexplained Popups"
Else
True3 = ""
End If

If CheckVirus_Trojans.value = True Then
True4 = " Virus/Trojans"
Else
True4 = ""
End If

If CheckWindows.Value = True Then
True5 = " Windows"
Else
True5 = ""
End If

If CheckOther.value = True Then
True6 = " Other"
TextOther.enabled = Item.UserProperties("Other")
TextOther.visible = Item.UserProperties("Other")

Else
True6 = ""
TextOther.enabled = Item.UserProperties("Other")
TextOther.visible = Item.UserProperties("Other")
End If
End Select

Textbox1.Value = "Computer Problems -" & True1 & True2 & True3 & True4 & True5 & True6

End Sub
 
S

Sue Mosher [MVP]

You shouldn't "write to the textbox" when a bound control is involved.
Instead, change the value of the bound property. Ditto the bound checkboxes:
Check the value of the property, not the control. The code is much simpler
and more efficient and usually can be debugged more easily.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top