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:
mailto:me@test.com?cc=him@test.com,attachment=c:\t.txt&subject=this%20is%20a%20subject&body=this%20is%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

0
scottb2
3/17/2010 4:44:28 AM
outlook.program_vba 490 articles. 0 followers. Follow

3 Replies
468 Views

Similar Articles

[PageSpeed] 7

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:
> mailto:me@test.com?cc=him@test.com,attachment=c:\t.txt&subject=this%20is%20a%20subject&body=this%20is%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
> 


0
Dmitry
3/17/2010 10:17:18 PM
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:
>
mailto:me@test.com?cc=him@test.com,attachment=c:\t.txt&subject=this%20is%20a%20subject&body=this%20is%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

0
scottb2
3/19/2010 7:32:41 PM
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

0
Ken
3/19/2010 8:37:54 PM
Reply:

Similar Artilces:

Outlook email not sending
My emails from Microsoft Outlook are not being sent. They just stay in the outbox. I have been receiving the following error message: Task 'mail.comcast.net - Sending' reported error (0x8004210B) : 'The operation timed out waiting for a response from the sending (SMTP) server. If you continue to receive this message, contact your server administrator or Internet service provider (ISP).' I receive emails with no problem. Any suggestions on what I need to do to get my emails to send? Nat ...

Multiple Emails using outllok 2003
AFter installing all updates and security features, I find with just a few specific emails ID's I use, I get 2-3 emails that are duplicates of each other. I tried deleting then re-creating the emails ID"s in outlook, but I still get multiple emails from one person who sent only one email. Yet just a few ID's will display copies of the origignal. Anyone help? Thanks, Greg Do you have Norton or McAfee installed scanning your incoming and outgoing mail? If yes, try turning it off and see if it improves. --� Milly Staples [MVP - Outlook] Post all replies to the group to...

Emails automotaically send to unintended recipeints
Recently sent mails are being automatically forwarded to unintended recipients. For example if a send an email to person A, it sometimes get forwarded to person B (another person in my address book, most of the time recently used email address) Pls. solve . Using MS Outlook and have re installed the mail browser several times, but the problem remains. Have you run a full scan with your antivirus software? (make sure it's a relatively recent version and you keep it updated) Also, can you reproduce the problem when you try? sanaullah@cyber.net.pk wrote: > Recently sent mai...

text in received emails is very small
A friend has Office 2003 and he uses Outlook. He is an older gentleman who's been running his own business for decades, and he uses Excel with lots of tabs in his worksheets. Here's the situation: In changing his monitor from 800x600 to 1024x768 so he can read more of the Excel tabs, the text in the body of his received emails is very small. Headers and folders are normal as well as typed text in created emails. What gives? Jack Did you check the zoom settings? HTML sizes can be changed on the view menu, plain text in tools, options, mail format, stationery and fonts. Or ...

switchboard fails to open automatically
Hi Folks, I have created a database in Access 2007. I have set the switchboard as the default, but it fails to launch automatically when the database is openned. It is the only switchboard in Switchboard Manager and it is set as the default. Please assist if you have any ideas. Thanks, -- Markb Go to tools/startup and set the switchboard to start when Access starts. "markb" wrote: > Hi Folks, > > I have created a database in Access 2007. I have set the switchboard as the > default, but it fails to launch automatically when the database is openned. > It is ...

Saving emails and contacts
how can i save my emails and contacts to cd as a backup? how can i also save all the settings of outlook to cd? thanks Basically copy the *.pst file/s See here http://www.slipstick.com/config/backup.htm#pst David "josh" <jpinsler@videotron.ca> wrote in message news:02fa01c36b3e$30bfdad0$a401280a@phx.gbl... > how can i save my emails and contacts to cd as a backup? > how can i also save all the settings of outlook to cd? > > thanks ...

How do I create emails with the mail merge manager?
Version: 2008 Operating System: Mac OS X 10.4 (Tiger) Processor: Power PC At work I have Office 2007 for Windows, and I can use Word to create mail merge e-mails with the mail merge manager. Why can't I do that with Mac 2008 on my home computer? I am using the student/teacher version, but why should that matter? This lack of feature equality between platforms won't be a big help for me being able to switch over to a Mac at work! You can do it. You don't say anything about what you tried, or where you ran into problems. You must set Entourage as the default email program, at lea...

Direct Email in CRM 3.0
Hi all, we've just upgraded MS CRM3.0 from 1.2. I can't find how to send Direct email to list of contacts. Though the feature seems to work exactly like in 1.2 (with the "Direct Email" button, then select the email template, etc.), the emails don't go. The email router is ok, because if we send an individual email to one contact, everything is ok. Any suggestion? Any help will be greatly appreciated. Hi- Did you verify that the CRM Bulk Email Service is running on your server? The service is not started by default. -Nathan -- Nathan Trueblood VP Client Services D...

Can Money automaticly add catorgies to transactions
can money autometicly add a catorgy to a transaction you download from your bank based on prior transactions? In microsoft.public.money, Insane Bill <Insane Bill@discussions.microsoft.com> wrote: >can money autometicly add a catorgy to a transaction you download from your >bank based on prior transactions? Yes. It learns by experience based on the Payee. So you would apply the category, and Money should catch on. "Insane Bill" <Insane Bill@discussions.microsoft.com> wrote in message news:81E7CBCB-9527-40C0-8AF4-51876A491250@microsoft.com... > can money aut...

Resize Excel column's width automatically
How can an Excel column's width automatically increase/decrease depending on the maximium number of digits in any one cell of the column. I am wanting to use this for a template so the column must be able to increase or decrease. I am using a version that came with Microsoft Office XP Professional. Dog, Double click the border in the column header. This is a one-time adjustment of the column width. It doesn't dynamically adjust the width to the widest cell as does the Row Height Autofit. -- Earl Kiosterud mvpearl omitthisword at verizon period net -----------------------------...

Outlook/ word email Error
I have an IMAP account setup in my Outlook 2002, when i try to create a new email in word it wont send, I click the send button and nothing happens. There is an accounts menue and nothing pops up when i click, and then i get an error that says there was a fatal error in outlook. I tried using the other email option besides word and there is no send button on those at all. any help would be appreciated... you can email me at Auben2005@hotmail.com Thanks! When you use the Test Account Settings while setting up your account, do you get any error messages? What is the exact message if you do? ...

User with different alias cannot POP email from server??
Running Exchange 5.5 and here's my situation. I have a user with an NT account of bsmith. Her alias is barbsmith because there was already a bsmith alias on another Exchange server in our network. This user can log into OWA fine by using her proper alias but I cannot get Outlook to POP her email from our server. I can open Outlook 2002 on my PC and use the Test Account button for pretty much any users account but it won't work with hers. If I test with hers I get a failure message. The only difference I can see between her account and other users is the alias. I tried deleting h...

Sending email from MSCRM #2
Please follow the instructions below to resolve this issue: Machine Names involved in this Example: Exchange Server: cwebex1.cweb.local CRM Server: cwebdell.cweb.local On the Exchange Server: 1. Confirm that you are logged in as a Domain User with Schema Admin and Enterprise Admin Rights. The reason for this is that Exchange Information Store can be thought of as a database. The only user that can access this database is the 'sa' user which happens to be a domain admin with Schema and Enterprise Admin Rights. 2. Uninstall the MSCRM Exchange Connector from the Add/Remove...

vbs script to list files in a directory and email results
Hi. Been trying to write something with out any luck. Im looking for a script that will look in a given directory (i.e. c:\mydata) and e-mail details of what files are in that directory, the details needed are file names, date modified and size. Anyone got any sample scripts ? Thanks "systemtek" <duncan@systemtek.co.uk> wrote in message news:8c076e3d-9231-452b-8700-fd6227eb9bc8@y12g2000vbg.googlegroups.com... > Hi. > > Been trying to write something with out any luck. Im looking for a > script that will look in a given directory (i.e. c:\...

Attachment in email doesn't appear until forwarded
This is an interesting problem that I have never ran across before. We have a user who orders from an online supplier on a regular basis. When an order is placed with this vendor they send a receipt back via email with a PDF version of the receipt. This is an automated process that we've been getting for over a year. Recently we upgraded our user from Win98 to WinXP and from Outlook Express to Outlook 2002. Since the move to the new OS and mail client our guy does not see an attachment when he receives mail from the supplier. He still gets the mail but there appears to be no attachme...

Within domain mail going to Junk Email on some users?
Hi Everyone, I have a weird situation, not sure if Exchange is causing it or if Outlook is. When certain users email others within our single domain, their mail goes directly to the recipient's junk email folder? Any thoughts as to why? No Rules are causing it that I can see... Thanks! On Thu, 5 Jan 2006 06:01:02 -0800, "Ken Montgomery" <KenMontgomery@discussions.microsoft.com> wrote: >Hi Everyone, > >I have a weird situation, not sure if Exchange is causing it or if Outlook >is. > >When certain users email others within our single domain, t...

poor quality images in sent emails
Sometimes, I wish to include a small image inline with the rest of the text in my emails. However, the quality of the image sent is much poorer than the quality of the image pasted in (or inserted). It appears that the colour depth has been reduced. Does anyone know whey this is happening and how I can correct it please Thanks Neil Version of Outlook? What is the image format when you insert it? Are you using HTML or RTF? What mail client is the recipient using? -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Coauthor, OneNote 2003 for Windows (V...

Sending email to a group
How can I send the same email to a group of people? In my previous email provider, I was able to send email up to 100 contacts at one time. I tried sending an email to 15 and was denied. Who is your 'current' e-mail provider? You have to ask them. WLMail doesn't set the limit. -- Bruce Hagen MS-MVP [Mail] Imperial Beach, CA "Ron" <Ron@discussions.microsoft.com> wrote in message news:20A0CEA1-78D9-4414-ACAC-8456419986E8@microsoft.com... > > How can I send the same email to a group of people? In my previous email ...

Recently I can not receive some emails, mostly from yahoo mail
I can not receive some emails from friends, mostly from YAHOO mail. Do you know anything about this? Are the friends getting the messages returned to them? If so, what does the returned message give as a reason? Otherwise check your Junk folder in Windows Live Mail program as well as the Junk/Spam/Trash, etc. folder via web mail for your mail service. -- Mike - http://TechHelp.Santovec.us "JP" <JP@discussions.microsoft.com> wrote in message news:E8631153-ED09-45CD-BA09-9C812C5E5478@microsoft.com... > I can not receive some emails from friends, mo...

Forwarding email on user causes LDAP constraint violation
Scenario: two completely different domains, bi-directional trust established (single domain forrests each). Desired solution: for some users in domain A who have an Exchange Server mailbox in that domain, create a fowarding to their email address on domain B where domains A and B are trusted bi-directionally. Result: chaning the properties of user in domain A under Exchange General tab, delivery options, to forward to a user email in domain B Exchange Server causes an error box: constraint violation LDAP provider. Any clues as to what needs to be done to make this work? Browsing t...

Emails stuck in "Pending Send" state
Whenever emails are sent out from CRM using a Quick Campaign, they stay in the "Pending Send" state forever. In the past, we've been able to solve this simply by restarting the email router service, but as of a month ago that's not working anymore. We have 2 exchange servers in a cluster, and I've tried both... no luck. There are no errors in the event log on either the Exchange server or the CRM server. Joshua, 1. Under which user account are the quick campaigns being sent? 2. Does Send Email work for that user? 3. Does that user's profile properly have their...

Can't see contact photo in the email header
I used to see my contact's photo (which I stored in the contact list) in the email header. I made some changes but I don't know how to bring it back. Help? Thanks! I forgot to add that this should happen only when I recieve an email from one of my contacts. "Mohamed" wrote: > I used to see my contact's photo (which I stored in the contact list) in the > email header. I made some changes but I don't know how to bring it back. > > Help? > > Thanks! Did you remove the photo from that persons contact? -- Diane Poremsky ...

How to delete certain emails before they reach the user's mailbox?
Hi 1. I'm dealing with Windows Small Business Server 2003 (as an administator) and Exchange Server 2003. 2. I would like to be able to create my own spam filter in C++ to run on the server and use with Exchange. 3. Is there a way to access the files which actually store the emails so that i could analyze them and delete certain ones before they reach the user's mailbox? Thanks, David. "David" <davidmccaldin@gmail.com> wrote: >1. I'm dealing with Windows Small Business Server 2003 (as an >administator) and Exchange Server 2003. > >2. I would like...

Problem when using send to -> as attachment and having the email NOT use the exchange server
We are using Outlook 2003 with both a POP3 account (the main email address for my library) and an exchange account that is only used for town communications. When we go into an office document and pick send to -> email as attachment the email always sends through the exchange account. We have set the POP3 account as default, gone into tools -> options -> send/recieve -> group accounts and told the exchange account to NOT send emails, and in the email itself we tell it specifically to use the POP3 account and it still sends the email with the exchnage server. Does anyone know how...

I can't make crm fetch replies on crm emails
Hi The problem is - I can't make crm fetch replies on crm emails. I can send an email from crm - it appears as a completed activity. But replies only get to outlook -- i need to promote them to activities manually. Is there anyway to find out why they dont get into crm automaticly? I have two servers - mscrm 1.2 (win2003) and exchange 2003. Any useful reply would be appreciated greatly. Thanks. Max ...