Can't Get From Field in Custom Form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

The code below in a custom form displays various fields except the From field
(which I dragged over from the Field Chooser). I used the name in the
properties, but I guess that's not it - the VB script gets an error. Could
someone tell me what the correct From field name is? Thanks.

Sub Item_PropertyChange(ByVal Name)

If Name = "Subject" then
msgbox "hello - Subject"
MsgBox "Subject = " & Item.subject
MsgBox " User Field Test = " & Item.UserProperties.Item("Test")
MsgBox "From = " & Item._RecipientControl1
end if

End Sub
 
When in doubt, check the object browser: Press ALt+F11 to open the VBA environment in Outlook, then press F2. Switch from <All Libraries> to Outlook to browse all Outlook objects and their properties, methods, and events. Select any object or member, then press F1 to see its Help topic.

It shouldn't be too hard to find the MailItem.SenderName property. This property is set only after the message is sent, though. You might want to explain just what you're trying to accomplish with your code.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Back
Top