Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming Forms / June 2009

Tip: Looking for answers? Try searching our database.

Accessing _RecipientControl1 (Assigned To)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
cmonroe21 - 15 Jun 2009 17:47 GMT
I am creating a custom task form in OL2007, and I want to make sure the
"Assigned To" box (bound to the Assigned to field) is not empty when Send is
clicked.  The name of the field associated with the Assigned To text box is
_RecipientControl1.  How do I access this _RecipientControl1 box to check if
the value is null or not?  And perhaps even to set it equal to a default
recipient via code if I choose to?  I tried Item._RecipientControl1, Item.
UserProperties("_RecipientControl1"), and Item.UserProperties.Find
("_RecipientControl1"), but each time I run it with the below code there is
an error that "Object variable not set."  Code doesn't make it to any message
boxes (see below).  Any suggestions?

Sub cmdSend_Click()
    Item.Assign()
    'If Item._RecipientControl1 <> "" Then        'Trial 1:  Invalid character
    'If Item.UserProperties("_RecipientControl1") <> "" Then    'Trial 2:
Object Variable not set
    If Item.UserProperties.Find("_RecipientControl1") <> "" Then    'Trial 3:
Object Variable not set
    MsgBox "_RecipientControl1 <> NULL"
    'Item.Send()
    Else
    MsgBox "_RecipientControl1 = NULL"
    'MsgBox "Please assign task before sending."
    End If
End Sub

P.S.  sorry for the commenting, but thought it might shed some light on what
I've tried and what I'm trying to accomplish
Sue Mosher [MVP] - 15 Jun 2009 18:03 GMT
Try checking the value of Item.Recipients.Count instead. In general, you
should work with control property values only when you want to change the
appearance of a control or when the control is not bound to an Outlook
property.
Signature

Sue Mosher, Outlook MVP
  Author of Microsoft Outlook 2007 Programming:
    Jumpstart for Power Users and Administrators
   http://www.outlookcode.com/article.aspx?id=54

>I am creating a custom task form in OL2007, and I want to make sure the
> "Assigned To" box (bound to the Assigned to field) is not empty when Send
[quoted text clipped - 26 lines]
>     End If
> End Sub
cmonroe21 - 15 Jun 2009 19:49 GMT
Works like a charm.  Thank you!  I think I was confused about the
_RecipientControl1 thing, good to know that I can bypass dealing with it!

>Try checking the value of Item.Recipients.Count instead. In general, you
>should work with control property values only when you want to change the
[quoted text clipped - 5 lines]
>>     End If
>> End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.