ResolveAll doesn't underline in the mail's "To"

K

Klemens

I'm using redemption to assemble a new mail with a list of recipients
from a different source. My code looks like this,,,

oSaveMail.Item = moMailItem
Set oRecipient = oApptItem.Recipients(i)
' ignore resources etc
Set oSaveRecp = oSaveMail.Recipients.AddEx(strRecipient, , , olTo)
oSaveRecp.Resolve False
strRecipient = oRecipient.Address
'set mail "To" and resolve
oSaveMail.To = strRecipients
oSaveMail.Recipients.ResolveAll
'moMailItem.Recipients.ResolveAll

As a result the recipients in the "To" field are not underlined. But I
want the m to be. When I use the last line instead, it becomes
underlined but shows a security popup.

Any idea?

- Klemens
 
D

Dmitry Streblechenko

Outlook cannot see changes made by MAPI until the item is completely
dereferenced and reopened.
Do you modify recipients of a message that is already being displayed or you
call Display after you add and resolve the recipients?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
K

Klemens

This form is opened from the Outlook menu and I intercept the
NewInspector event and populate the form and the reciepients there. I
suspect this is "too late". First I was wondering why it work incase I
call ResolveAll on the Outlook item. But now it is obvious.
 
D

Dmitry Streblechenko

In most cases adding and deleting a user property forces Outlook to refresh
the recipients list, I don't know if that will work in the NewInspector
event:

Prop = moMailItem.UserProperties.Add("test", olText);

Prop.Value = "test";

Prop.Delete();


Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
S

Sue Mosher [MVP-Outlook]

Apparently getting the Body property can also have the same effect. Weird, yes?
 
D

Dmitry Streblechenko

Weird is the definition of "Outlook" in most dictionaries :)

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

Apparently getting the Body property can also have the same effect. Weird,
yes?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top