A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Using MailEnvelope



 
 
Thread Tools Search this Thread Display Modes
  #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
  #2  
Old April 12th 06, 07:23 PM posted to microsoft.public.outlook.program_vba
Ridge Kennedy
external usenet poster
 
Posts: 11
Default Using MailEnvelope

Ooops. Hold on.

I think I got it to work. I was using a template as my "test doc" instead
of an ordinary document. Getting closer.

R.

"Ridge Kennedy" wrote in message
...
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)



  #3  
Old April 12th 06, 07:33 PM posted to microsoft.public.outlook.program_vba
Ridge Kennedy
external usenet poster
 
Posts: 11
Default Using MailEnvelope

Update: What's happening seems to be this: I can't open the message in
Outlook until all the current Word documents are closed.

R.
"Ridge Kennedy" wrote in message
...
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)



  #4  
Old April 13th 06, 02:42 AM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Using MailEnvelope

What happens when you try?

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Ridge Kennedy" wrote in message ...
Update: What's happening seems to be this: I can't open the message in
Outlook until all the current Word documents are closed.

R.
"Ridge Kennedy" wrote in message
...
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)



  #5  
Old April 13th 06, 10:53 PM posted to microsoft.public.outlook.program_vba
Ridge Kennedy
external usenet poster
 
Posts: 11
Default Using MailEnvelope

Sue said:

What happens when you try?


I was able to see the new item in the drafts folder of outlook, but not open
it.

I found that if, after

itm.Save


I add a line

activedocument.close wdsavechanges = false

.. . . it works as you said it would, opening the message for further
processing and a final "send".

It ends up as an HTML message and I would have liked RTF, but I guess the
newspapers can live with that.

Thank you for your help and helpful nudge.

Sincerely,

Ridge






 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:01 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.