TO field on Read Page not resolving

Status
Not open for further replies.

mjg

Member
Outlook version
Outlook 2007
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!
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
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 -
 

mjg

Member
Outlook version
Outlook 2007
Email Account
Exchange Server
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
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
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
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
S BCM Compulsory field, New opportunity Outlook VBA and Custom Forms 0
M Sudden change in From field - now very short Using Outlook 4
L Automatically Insert Recipient Name from To Field Outlook VBA and Custom Forms 33
J Assess content of User Defined Field in Rule Using Outlook 3
K Contact notes field replicating Using Outlook 6
G Copy Contact field to Appointment Custom Form Field Outlook VBA and Custom Forms 2
Caio "From" field doesn't show extra email addresses in Outlook 2016. Using Outlook.com accounts in Outlook 6
T "From" field font size in table list of emails Using Outlook 0
skyfox VBA to search email subject field for a certain string Outlook VBA and Custom Forms 3
E Inbox field customization Using Outlook 1
A How to get rid of Contacts field when printing emails? Using Outlook 0
George Simpson "Switch to HTML" in Outlook 2016 notes field Using Outlook 1
S Outlook User defined date field (UDF) not syncing Using Outlook 2
I Locating an email after search - Field Chooser Using Outlook 2
Diane Poremsky Create a custom field for Outlook messages New Slipstick.com Articles 0
Diane Poremsky Create a Custom Numbering Field for Outlook messages New Slipstick.com Articles 0
T Uploading Outlook 2016 Contacts to Exchange Server Drops "Company" field data in 30% of records Exchange Server Administration 4
Diane Poremsky Display the Created Date field of any Outlook item New Slipstick.com Articles 0
S Selecting "Mileage" field on "Detail" page Outlook VBA and Custom Forms 2
A Add attachments to appointment based on field values Outlook VBA and Custom Forms 0

Similar threads

Top