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

Automatically modifying an email



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old March 17th 10, 04:49 AM posted to microsoft.public.outlook.program_vba
scottb2
external usenet poster
 
Posts: 9
Default Automatically modifying an email


Since I can't seem to get attachments to work with "mailto" (see my
previous post "URL opening a new email"), I'm thinking about another
way. If I were to issue the following URL in IE:
,attachment=c:\t .txt&subject=this%20is%20a%20subject&body=this%20i s%20a%20body

which places the filename to be attached in the "To" line. I'd then
programatically remove the filename from the "To" line and add the
attachment.

I'm not sure how to run my code just by creating the email with the
URL. Also, is it possible to remove an address from the "To" list? Any
pointers are appreciated.

Thanks,
Scott


--
scottb2
http://forums.slipstick.com

Ads
  #2  
Old March 17th 10, 10:17 PM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Automatically modifying an email

You cannto add attachments through the mailto protocol.

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"scottb2" scottb2.47ybta@invalid wrote in message
news:scottb2.47ybta@invalid...

Since I can't seem to get attachments to work with "mailto" (see my
previous post "URL opening a new email"), I'm thinking about another
way. If I were to issue the following URL in IE:
,attachment=c:\t .txt&subject=this%20is%20a%20subject&body=this%20i s%20a%20body

which places the filename to be attached in the "To" line. I'd then
programatically remove the filename from the "To" line and add the
attachment.

I'm not sure how to run my code just by creating the email with the
URL. Also, is it possible to remove an address from the "To" list? Any
pointers are appreciated.

Thanks,
Scott


--
scottb2
http://forums.slipstick.com



  #3  
Old March 19th 10, 07:32 PM posted to microsoft.public.outlook.program_vba
scottb2
external usenet poster
 
Posts: 9
Default Automatically modifying an email


True, but in the first email, I described a method of getting around the
problem. I'm using mailto to open an email and fill in everything
except for the attachment. I then need to gain control by handling some
event and then using Item.Attachment to create the attachment.

So I have two problems. The first problem is how to let my code know
what is supposed to be attached. By specifying a fake "To" address (as
described in the first email), the code can do the right thing. I then
only need to know how to get control. Would a NewInspector event
handled in the ThisOutlookSession module do the job?

Is the "fake To: address" method workable? Is NewInspector the event
that ThisOutlookSession should be using to get control?

I'm trying to go about it this way because there should be only two
keys hit once the information is selected: the first causes the mailto
command to be constructed and issued and the second submits the email.
I can't have any more keys hit to manually attach a file, manually
select the email, etc.

Scott

Dmitry Streblechenko;133342 Wrote:
You cannto add attachments through the mailto protocol.


--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"scottb2" scottb2.47ybta@invalid wrote in message
news:scottb2.47ybta@invalid...[color=blue]

Since I can't seem to get attachments to work with "mailto" (see my
previous post "URL opening a new email"), I'm thinking about another
way. If I were to issue the following URL in IE:

,attachment=c:\t .txt&subject=this%20is%20a%20subject&body=this%20i s%20a%20body

which places the filename to be attached in the "To" line. I'd then
programatically remove the filename from the "To" line and add the
attachment.

I'm not sure how to run my code just by creating the email with the
URL. Also, is it possible to remove an address from the "To" list?

Any
pointers are appreciated.



--
scottb2
http://forums.slipstick.com

  #4  
Old March 19th 10, 08:37 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Automatically modifying an email

The mailto: protocol opens an Outlook item using Simple MAPI.

In Outlook 2002 or later you do get that Inspector added to the Inspectors
collection, but there is no NewInspector() event. There are no events
telling you an item was added. That's true even in Outlook 2010.

The only way I've found to do what you want to do is to use a timer to check
the Inspectors collection against a list of handled Inspectors. I use
Inspector wrappers and wrapper collections anyway, so the infrastructure is
there already for me in any of my addins. If I find an unhandled Inspector I
know it's a Simple MAPI Inspector (which are opened modally, BTW).

Of course there are a number of flags I have to maintain and various
interlocks to make sure I don't handle a normal Outlook Inspector in both
NewInspector() and my timer event handler and end up handling an Inspector
twice. And I double-check on matching Inspectors with more than captions,
for example getting the Inspector window handle and then checking the window
RECT and screen position for a match, among other things. There are a number
of fault use cases where simple matching fails.

A fake To address could work but the item has to be saved to fill that in.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"scottb2" scottb2.48364a@invalid wrote in message
news:scottb2.48364a@invalid...

True, but in the first email, I described a method of getting around the
problem. I'm using mailto to open an email and fill in everything
except for the attachment. I then need to gain control by handling some
event and then using Item.Attachment to create the attachment.

So I have two problems. The first problem is how to let my code know
what is supposed to be attached. By specifying a fake "To" address (as
described in the first email), the code can do the right thing. I then
only need to know how to get control. Would a NewInspector event
handled in the ThisOutlookSession module do the job?

Is the "fake To: address" method workable? Is NewInspector the event
that ThisOutlookSession should be using to get control?

I'm trying to go about it this way because there should be only two
keys hit once the information is selected: the first causes the mailto
command to be constructed and issued and the second submits the email.
I can't have any more keys hit to manually attach a file, manually
select the email, etc.

Scott


 




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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Modifying the To, CC and BCC fields lgwapnitsky Outlook and VBA 2 August 28th 08 10:19 PM
Automatically Add Email Contacts and Access to Email addresses sto StephenAtStrakkaRacingDotCom Outlook - Using Contacts 1 April 16th 08 12:24 PM
Modifying the email message window Brent Add-ins for Outlook 2 January 29th 07 02:04 PM
automatically delted email after clicking a link in email? drone1 Outlook - Installation 1 June 27th 06 07:27 PM
Modifying a Form [email protected] Outlook and VBA 1 April 5th 06 12:59 AM


All times are GMT +1. The time now is 12:50 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.