M
Malcolm
Hi,
I understand that all outlook forms share a message
control.
For email, it's the main body.
For contacts, it's the notes field.
I also understand that this field is bound to the Body
property of the item.
What I am having trouble with is how to refer to this
field in VBScript or VBA.
I understand how to refer to controls in general, I just
do not know what this is called programmatically.
If I look at Properties, I only see the one tab, and in
the contact form it says the name is 'Notes'.
Referring to it by this name results in an error though,
because it is not the true name.
My goal is the ability to set/unset the ReadOnly property
of the field based on the clicking of a checkbox by
particular users.
<i>
Sub EditNotes_Click()
dim MyValue, User, objPage
User = Application.GetNameSpace
("MAPI").CurrentUser
Set objPage = Item.GetInspector.ModifiedFormPages
("General")
MyValue = objPage.Controls("EditNote")
if(User = "a" Or User = "b" Or User = "c" Or User
= "d" Or User = "e") Then
<b>objPage.Controls("Notes").ReadOnly =
MyValue</b>
else
if (MyValue) then 'clicked, turn back off
objPage.Controls("EditNote") =
false
else 'not clicked, turn back on
objPage.Controls("EditNote") =
true
msgbox "Turned on"
end if
end if
End Sub
</i>
I understand that all outlook forms share a message
control.
For email, it's the main body.
For contacts, it's the notes field.
I also understand that this field is bound to the Body
property of the item.
What I am having trouble with is how to refer to this
field in VBScript or VBA.
I understand how to refer to controls in general, I just
do not know what this is called programmatically.
If I look at Properties, I only see the one tab, and in
the contact form it says the name is 'Notes'.
Referring to it by this name results in an error though,
because it is not the true name.
My goal is the ability to set/unset the ReadOnly property
of the field based on the clicking of a checkbox by
particular users.
<i>
Sub EditNotes_Click()
dim MyValue, User, objPage
User = Application.GetNameSpace
("MAPI").CurrentUser
Set objPage = Item.GetInspector.ModifiedFormPages
("General")
MyValue = objPage.Controls("EditNote")
if(User = "a" Or User = "b" Or User = "c" Or User
= "d" Or User = "e") Then
<b>objPage.Controls("Notes").ReadOnly =
MyValue</b>
else
if (MyValue) then 'clicked, turn back off
objPage.Controls("EditNote") =
false
else 'not clicked, turn back on
objPage.Controls("EditNote") =
true
msgbox "Turned on"
end if
end if
End Sub
</i>