Accessing _RecipientControl1 (Assigned To)

Status
Not open for further replies.
C

cmonroe21

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


 
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.

Sue Mosher

"cmonroe21 " <u48566@uwe> wrote in message

news:97a53271c0581@uwe...
> 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
 
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!

Sue Mosher [MVP] wrote:
> 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.
> >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



 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
S Problem Accessing .MSG Property 'ImageNaturalHeight' Tag '0x80010003' Outlook VBA and Custom Forms 1
M Accessing ALL Outlook contact fields Outlook VBA and Custom Forms 3
RBLampert Accessing Outlook accounts from multiple computers Using Outlook 8
E Accessing shared outlook folder doesn't work since switch to new outlook/excel Outlook VBA and Custom Forms 11
J Accessing calendar items for Resource Mailboxes Outlook VBA and Custom Forms 2
S Outlook [Online - Office365] perfomance is getting affected when accessing the mails using Redemptio Using Outlook 1
J Accessing Hotmail accounts with Outlook 2016 Using Outlook 3
n2b Accessing Plain Text Draft Without Outlook Using Outlook 3
G Issues with accessing Outlook Contact Picture with VBA Outlook VBA and Custom Forms 4
M Accessing ExpiryTime property Outlook VBA and Custom Forms 1
M Accessing BCM with Excel / Running Reports BCM (Business Contact Manager) 1
C Problem accessing events for folder "username" Server Threw Exception Using Outlook 1
P accessing custom task pane with Outlook ActiveInspector Using Outlook 1
mikecox Accessing Outlook on my Win7 desktop from Win8 laptop Using Outlook 1
A "Unable to display the folder" error when accessing Group mailbox Using Outlook 0
Commodore Accessing mail from multiple devices Using Outlook 1
S Programmatically accessing Outlook Calendar data Using Outlook 1
E Accessing User Defined Fields in BCM Database part 2 BCM (Business Contact Manager) 0
E [SOLVED] Accessing User Defined Fields in BCM Database part 1 BCM (Business Contact Manager) 9
R Accessing folder 'Other Contacts' Outlook VBA and Custom Forms 1
E Accessing a Form Region from an Inspector Outlook VBA and Custom Forms 3
E Accessing a Form Region from an Inspector Outlook VBA and Custom Forms 3
D Accessing Global Address List details with VBA Outlook VBA and Custom Forms 1
H Accessing a control on a frame in Outlook with VBScript Outlook VBA and Custom Forms 1
K Programmatically accessing Outlook properties Outlook VBA and Custom Forms 3
K assistant accessing from her home computer BCM (Business Contact Manager) 2
A Accessing .pst folder in outlook using VBA Code Outlook VBA and Custom Forms 4
J Outlook closes when accessing History in BCM BCM (Business Contact Manager) 4
B Accessing Outlook 2003 Signature Programmatically using C# Outlook VBA and Custom Forms 6
L Outlook Forms-Accessing Outlook VBA and Custom Forms 1
K Accessing contact's custom properties in a Outlook 2007 form region Outlook VBA and Custom Forms 1
V Outlook custom form - installing and accessing Outlook VBA and Custom Forms 1
A Daily hours of recurring/ multi-day appts, & accessing mult calend Outlook VBA and Custom Forms 2
R New users creating get page cannot be displayed when accessing OWA Exchange Server Administration 16
P Emails assigned with a certain category (within a shared inbox) to be copied to a specific folder. Outlook VBA and Custom Forms 2
F How to show assigned tasks under certain mailbox? Using Outlook 4
P how to remove unwanted PST file default categories assigned to many calendar entries Using Outlook 7
C Changing Domain -- Assigned To User field Migration? BCM (Business Contact Manager) 1
D Macro to export mail data based on assigned category Using Outlook 3
mrje1 Assigned Categories keep getting deleted in mail, bug? How to fix if possible? Using Outlook 5
A Can Rule Check Category Contact is assigned? Using Outlook 1
P Can't Add User to Assigned to List in a Shared BCM2010 BCM (Business Contact Manager) 2
K Set "Assigned To" for a Contact Item Outlook VBA and Custom Forms 5
P Custom Task Cannot be open when assigned. Outlook VBA and Custom Forms 7
S reminder for assigned tasks Using Outlook 5

Similar threads

Back
Top