TO field on Read Page not resolving

Status
Not open for further replies.

mjg

Member
Outlook version
Email Account
Exchange Server
Hi, I have what should be a simple approval form built as an outlook custom form. The compose page contains a form with several text fields, a To button that brings up the GAL to choose a recipient, and a Submit button that calls Item.Send. The read page is simply a copy of the compose page with the fields disabled along with an additional text box for notes and another To button to choose the next recipient from the GAL and a button that calls an "Approved" action to an approval form. The compose->send works fine, the received read page shows the filled-out form, and the read page's To button chooses an new recipient from the GAL and populates a text box bound to the TO address field. However, when this form is sent from the custom action, the exchange server returns the following:

Your message did not reach some or all of the intended recipients.
Subject: Supervisor Award - Budget Approved
Sent: 6/13/2012 3:08 PM

The following recipient(s) cannot be reached:

Notice that there are no recipients listed afterwards. I have noticed that when the TO recipient is displayed in the bound text box on the read page after being chosen from the GAL, it isn't underlined. I have tried doing Item.Recipients.Add() and setting recipient.Type = 1 'Outlook.OlMailRecipientType.olTo and doing a recipient.Resolve and If recipient.Resolved before calling the action, all to no avail. What am i missing? Any help would be greatly appreciated!
 
Try forcing a save - you should be able to hit Save before sending and see if it works. If so, add a Save to the code. You could also try Recipients.ResolveAll - it might not help, depending on how/when you did the recipient.resolve.

you may also want to try the msdn forum -http://social.msdn.microsoft.com/Forums/office/en-US/home?forum=outlookdev -
 
Thanks for your reply Diane,

I've tried forcing the save before sending, but am getting the same "Undeliverable" error. And, using ResolveAll doesn't resolve the TO address. Is it not possibler to have more than one control on the item that is bound to the TO field? I have one textbox on the Compose page and one on the Read page. Different names, but both bound to the TO field. Below is the Sub that calls the "Approve" action:

Sub cmdApprove_Click()

'msgbox("Approved")
Dim theInspector
Dim thisPage
Dim toButton
Dim oMailItem
Dim myRecipient
Dim recipients

'---Get refrences to the controls
Set theInspector = Item.GetInspector
Set thisPage = theInspector.ModifiedFormPages("AwardNomination")
Set toButton = thisPage.Controls("ToButton")
If Item.UserProperties("To") = "" Then
msgbox("Please Select an Approving Official")
toButton.SetFocus
Else
Set oMailItem = Application.ActiveInspector.CurrentItem

Item.UserProperties("Originator") = GetSMTPAddressForRecipients(oMailItem)

'MsgBox Item.UserProperties("Originator").Value

Set recipients = Item.Recipients
Set myRecipient = recipients.Add(ResolveDisplayNameToSMTP(Item.UserProperties("To").Value))

'MsgBox "To SMTP = " & ResolveDisplayNameToSMTP(Item.UserProperties("To").Value)
myRecipient.Type = 1 'Outlook.OlMailRecipientType.olTo

'myRecipient.Resolve
Item.Recipients.ResolveAll
If myRecipient.Resolved Then
Actions("Approve").Execute
Else
MsgBox "Recipient Not Found in Global Address List"
End If
End If

End Sub

Thanks Again,

-Mike
 
check with the developers in the MSDN forums - Outlook for Developers Forum - but I don't think you can bind two controls to the To field, even though they are on separate read and compose pages.
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
M Making Subject field writable (disable Read Only) Outlook VBA and Custom Forms 2
P Custom field is read only Using Outlook 1
M What is the recommendet way to read/write a user defined Field (Named Property) in the MailItem Obje Outlook VBA and Custom Forms 1
M What is the recommendet way to read/write a user defined Field (Named Property) in the MailItem Obje Outlook VBA and Custom Forms 5
P Can't add custom field to custom Outlook form, it always adds to the Folder instead Outlook VBA and Custom Forms 2
H Copying email address(es) in body of email and pasting in To field Outlook VBA and Custom Forms 1
D Outlook VBA forward the selected email to the original sender’s email ID (including the email used in TO, CC Field) from the email chain Outlook VBA and Custom Forms 2
D Outlook 365 Custom forms field limit? Outlook VBA and Custom Forms 4
Witzker Set Cursor & Focus from any field to the body of a user Contact form in OL 2019 Outlook VBA and Custom Forms 1
S Combination Field (Date Format) Outlook VBA and Custom Forms 0
Witzker Add a text line at the end of the note field in all selected Contacts Outlook VBA and Custom Forms 7
M copy field value to custom field Outlook VBA and Custom Forms 0
J images on note field display fraction of size Using Outlook 5
C Automatically Insert Recipient Name from To Field Outlook VBA and Custom Forms 4
J How to create a drop down user defined field that will appear on an inbox view Outlook VBA and Custom Forms 8
C Move or copy from field to field Outlook VBA and Custom Forms 0
O Filter-Query Builder-Description - what field name to use? Using Outlook 4
J VBA Cannot programmatically input or change Value for User Defined field Using Outlook 1
justicefriends How to set a flag to follow up using VBA - for addressee in TO field Outlook VBA and Custom Forms 11
N Contact Form Notes Field Touch vs Mouse Using Outlook 0
S CONTACT FIELD PRINT ORDER Outlook VBA and Custom Forms 1
V Checking for empty field Outlook VBA and Custom Forms 2
V Update new custom field Outlook VBA and Custom Forms 5
HappyDaddy007 "Size" on field chooser/column displaying incorrect value Using Outlook 3
A Is there an ID field you can use to pair a reply to the sent email? Outlook VBA and Custom Forms 4
H Information from user defined field into Excel Outlook VBA and Custom Forms 7
I Outlook 2003 shows html code when To: field is empty Using Outlook 7
Terry Sullivan Sender's Name Doesn't Appear in the From Field on Outlook 365/IMAP Using Outlook 2
D Outlook Contacts Notes Field Photos to Smartphone Using Outlook 0
S Custom Field Cannot Be Displayed In Views Outlook VBA and Custom Forms 2
Terry Sullivan Sender Field Displays My E-Mail Address, Not My Name Using Outlook 1
S Create a clickable custom column field Outlook VBA and Custom Forms 0
B User defined field for messages with 'me' in the [To], [Cc] line Using Outlook 0
V Limiting text length in free text field Outlook VBA and Custom Forms 2
C Outlook 2016 Conditional Format for User Defined Field Using Outlook 1
C Copy Outlook contact field value to another field Outlook VBA and Custom Forms 1
A new labeled phone field Using Outlook 4
V Making a Date field mandatory in outlook form Outlook VBA and Custom Forms 2
B Outlook Business Contact Manager with SQL to Excel, User Defined Fields in BCM don't sync in SQL. Can I use VBA code to copy 1 field to another? BCM (Business Contact Manager) 0
BretAB Is it possible to add a lookup field to a Message form? Outlook VBA and Custom Forms 4
N Exporting IM Address field Using Outlook 2
M Using field names to capture a data element Using Outlook 0
J How to restore field no longer visible in field chooser? Using Outlook 1
S Custom Form, copy user field data to message body Outlook VBA and Custom Forms 12
R What's supposed to appear when just clicking into the search field? Using Outlook 7
A Missing context menu on Location field Using Outlook 2
G Entered data in custom field goes in card and does not stay in list view Outlook VBA and Custom Forms 1
C Changed By field not displaying individual user's name in O365 Shared Mailbox Using Outlook 9
C Import Outlook 2016 contacts into to: field Using Outlook 1
T Source of Outlook 2016 Address field dropdown "Other Suggestions" Using Outlook 3

Similar threads

Back
Top