Create one-off that does send winmail.dat


N

Nick

For years we've used the "Exchange Extensions" function SetRecipients() that
lets you use Extended MAPI to create an address list and then add that list
to a message that the user is composing. Of course with Outlook 2010
Exchange Extensions are gone. This functionality is required because we need
to create one-off addresses that force winmail.dat to be sent to the
recipient. I know that most people want to get rid of winmail.dat, but we
need it because our users can send messages to our SMTP gateway that parses
winmail.dat. This SMTP gateway is "legacy" code that I can't change.

Using the newer Outlook object model and adding recipients to a MailItem
would be nice, if only it would allow me to enable the "send rich info"
behavior. But it appears that Microsoft has eliminated this functionality by
not providing a means for a programmer to create a one-off in a message that
is being composed that would force winmail.dat to be sent to the recipient
(you can do this manually in Outlook by changing the "Internet format" for an
address to "Send using Outlook Rich Text format").

I'm familiar with Extended MAPI, so I've tried using ModifyRecipients() to
add a one-off to a IMessage obtained from a MailItem.MAPIOBJECT, but there
appears to be a disconnect between the Extended MAPI world and the MailItem,
and the recipients in the MailItem are not changed (don't appear). Also,
I've tried using the object model technique, adding a recipient like so
"Name[EX:[email protected]]" that causes Outlook to enable the "send rich
info" the way I want, but that's not the address I want to send to, I want it
to go via SMTP to "(e-mail address removed)" and not an EX: address.

I know how to write add-ins and create ribbons for user-interface changes,
but I'm at a loss for how to add a one-off recipient to a message that a user
is composing, that forces the properties to send winmail.dat to that
recipient (i.e., Internet format = Send using Outlook Rich Text format), and
have that new address appear in the list of recipients that the user sees.

Any suggestions? Thanks in advance...
 
Ad

Advertisements

D

Dmitry Streblechenko

When exactly do you add the recipients? When yo uare using Extended MAPi
(be that from ECE or from MailItem.MAPIOBJECT), OOM has hard time seeing the
changes, but there are some workarounds.

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

Nick

Hi Dmitry,

For Outlook 2010 I have a ribbon with a RibbonType of
Microsoft.Outlook.Mail.Compose, and when the user clicks a button in my
ribbon I open a dialog to get some information, and then add the recipient.
The process is interactive with the user because it's done during the mail
compose user interface.

private void button1_Click(object sender,RibbonControlEventArgs e)
{
Outlook.Application application = Globals.ThisAddIn.Application;
Outlook.Inspector inspector = application.ActiveInspector();
Outlook.MailItem myMailItem = (Outlook.MailItem)inspector.CurrentItem;

// show my dialog to get some info, then add the recipient
}


Dmitry Streblechenko said:
When exactly do you add the recipients? When yo uare using Extended MAPi
(be that from ECE or from MailItem.MAPIOBJECT), OOM has hard time seeing the
changes, but there are some workarounds.

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
Nick said:
For years we've used the "Exchange Extensions" function SetRecipients()
that
lets you use Extended MAPI to create an address list and then add that
list
to a message that the user is composing. Of course with Outlook 2010
Exchange Extensions are gone. This functionality is required because we
need
to create one-off addresses that force winmail.dat to be sent to the
recipient. I know that most people want to get rid of winmail.dat, but we
need it because our users can send messages to our SMTP gateway that
parses
winmail.dat. This SMTP gateway is "legacy" code that I can't change.

Using the newer Outlook object model and adding recipients to a MailItem
would be nice, if only it would allow me to enable the "send rich info"
behavior. But it appears that Microsoft has eliminated this functionality
by
not providing a means for a programmer to create a one-off in a message
that
is being composed that would force winmail.dat to be sent to the recipient
(you can do this manually in Outlook by changing the "Internet format" for
an
address to "Send using Outlook Rich Text format").

I'm familiar with Extended MAPI, so I've tried using ModifyRecipients() to
add a one-off to a IMessage obtained from a MailItem.MAPIOBJECT, but there
appears to be a disconnect between the Extended MAPI world and the
MailItem,
and the recipients in the MailItem are not changed (don't appear). Also,
I've tried using the object model technique, adding a recipient like so
"Name[EX:[email protected]]" that causes Outlook to enable the "send
rich
info" the way I want, but that's not the address I want to send to, I want
it
to go via SMTP to "(e-mail address removed)" and not an EX: address.

I know how to write add-ins and create ribbons for user-interface changes,
but I'm at a loss for how to add a one-off recipient to a message that a
user
is composing, that forces the properties to send winmail.dat to that
recipient (i.e., Internet format = Send using Outlook Rich Text format),
and
have that new address appear in the list of recipients that the user sees.

Any suggestions? Thanks in advance...


.
 
Ad

Advertisements

N

Nick

I found that the recipients can be accessed and modified by Extended MAPI in
the message at MailItem.MAPIOBJECT, but only when the
MailItem.BeforeCheckNames event is called when the user clicks Send. So I'm
able to add a recipient using the object model while the message is being
composed (the user can see the new recipient), and then when the user clicks
Send I can use Extended MAPI to modify recipients going to my gateway,
replacing the recipient with a new one-off making sure that "send rich info"
is enabled. Not ideal, but it seems to work. I hope that Microsoft doesn't
remove the ability to modify recipients with Extended MAPI off of the
BeforeCheckNames event, or I would have a real problem!

Dmitry Streblechenko said:
When exactly do you add the recipients? When yo uare using Extended MAPi
(be that from ECE or from MailItem.MAPIOBJECT), OOM has hard time seeing the
changes, but there are some workarounds.

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
Nick said:
For years we've used the "Exchange Extensions" function SetRecipients()
that
lets you use Extended MAPI to create an address list and then add that
list
to a message that the user is composing. Of course with Outlook 2010
Exchange Extensions are gone. This functionality is required because we
need
to create one-off addresses that force winmail.dat to be sent to the
recipient. I know that most people want to get rid of winmail.dat, but we
need it because our users can send messages to our SMTP gateway that
parses
winmail.dat. This SMTP gateway is "legacy" code that I can't change.

Using the newer Outlook object model and adding recipients to a MailItem
would be nice, if only it would allow me to enable the "send rich info"
behavior. But it appears that Microsoft has eliminated this functionality
by
not providing a means for a programmer to create a one-off in a message
that
is being composed that would force winmail.dat to be sent to the recipient
(you can do this manually in Outlook by changing the "Internet format" for
an
address to "Send using Outlook Rich Text format").

I'm familiar with Extended MAPI, so I've tried using ModifyRecipients() to
add a one-off to a IMessage obtained from a MailItem.MAPIOBJECT, but there
appears to be a disconnect between the Extended MAPI world and the
MailItem,
and the recipients in the MailItem are not changed (don't appear). Also,
I've tried using the object model technique, adding a recipient like so
"Name[EX:[email protected]]" that causes Outlook to enable the "send
rich
info" the way I want, but that's not the address I want to send to, I want
it
to go via SMTP to "(e-mail address removed)" and not an EX: address.

I know how to write add-ins and create ribbons for user-interface changes,
but I'm at a loss for how to add a one-off recipient to a message that a
user
is composing, that forces the properties to send winmail.dat to that
recipient (i.e., Internet format = Send using Outlook Rich Text format),
and
have that new address appear in the list of recipients that the user sees.

Any suggestions? Thanks in advance...


.
 

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