View Single Post
  #1  
Old April 12th 06, 05:50 PM posted to microsoft.public.outlook.program_vba
Ridge Kennedy
external usenet poster
 
Posts: 11
Default Using MailEnvelope

Sue Mosher suggested, in a thread on copying rtf text into a message:

Great, because that means you can use the "Office envelope" feature to
create the message directly from the Word document -- no copy and paste
required:


Set env = ActiveDocument.MailEnvelope
Set itm = env.Item ' this is the Outlook message
itm.To = "
itm.Subject = "the subject"
itm.Send ' this will trigger a security prompt


So far, sort of so good. I was able to send a message to myself. It did
try to run spell check but I didn't get a security warning. We've used
office administrative policy to disable some of the warnings for some
attachments, though.

If you want the user to be able to edit and set Outlook properties on the
outgoing item, you can save the message and display it like this:


Yeah -- they have to be able to insert a list of e-mail addresses from other
sources, for example.

itm.Save


I get stuck here. After some experimenting, including having to add myself
to the sharing list for the draft items folder in Outlook, I did get an
corresponding header in the draft items folder. But not a messsage that I
could open??

Had to fiddle with the EntryID a while before finding out it's a string
(variable wouldn't work) and so I was able to muddle through


id = itm.EntryID
Set ol = CreateObject("Outlook.Application")
Set ns = ol.GetNamespace("MAPI")
Set msg = ns.GetItemFromID(id)
msg.Display


But no luck at the end.

I was kind of astonished by the paucity of information/documentation about
the MailEnvelope property from MS or anywhere else. But maybe I'm looking
in the wrong places.

Sincerely,

R (in New Joisey)


Ads