More Outlook Resource Sites

Microsoft Developer Network (MSDN)

FAQs and other general resources

Login

login
password
Remember me

You will need to register and log in if you want to download the source code for the Microsoft Outlook Programming book. The forums and code sharing areas are open to both registered and non-registered visitors.

share code 02-Sep-2010 22:24

Looking for help with Outlook programming projects — VSTO, add-ins, VBA, custom Outlook forms, etc.? You′ve come to the right place!

NEW! >> Subscribe to this site via RSS. For more RSS options, see the complete list of feeds on our main news page.

 

Code level: beginner    Code area: Basic Outlook Printer Friendly Version
Title: Create task from e-mail message (revised)
Description: This revised version of an earlier sample shows how to use the Namespace.GetItemFromID method in a "run a script" rule procedure to avoid getting security prompts in Outlook 2003 when the code accesses the Body property. Note that attachments cannot be copied directly between items. They must be saved to the system first, as discussed at http://www.outlookcode.com/d/code/copyatts.htm.
Date: 07-Jul-2005  01:03
Code level: beginner
Code area: Basic Outlook
Posted by: Sue Mosher
Body:
All 119comments
Page [ 1 2 3 4 5 6 7 8 9 10 Next >>  
  05-Aug-2005  07:42   
How do I get a toolbar button appear that can be clicked to run this code on the selected (or open) email?
  05-Aug-2005  15:09   
Set myItem = GetCurrentItem()
If myItem.Class = olMail Then
    MakeTaskFromMail2 myItem
End If

where GetCurrentItem is the function from the sample at http://www.outlookcode.com/codedetail.aspx?id=50
  23-Aug-2005  22:27   
Hi hows it going!

I've been testing this script, and it works well, however Outlook comes up each time saying: A Program is trying to access e-mail addresses you have stored in Outlook. Do you want to Continue? If this is unexpected, it may be a virus and you should choose "NO""

And then has an option to only "Allow Access for (dropdown box) list of 1,2,5,10,15mins" - is there anyway to indefinately allow access?

The Rule is based on a Distribution List stored on our Address Books -
  25-Aug-2005  08:30   
Brad, the code above will avoid a securitiy prompt in Outlook 2003. See http://www.outlookcode.com/d/sec.htm for your options for other versions.
  14-Sep-2005  03:13   
Great script, question:

is there a way to add the original mail as an attachment in the body of the created task:
i know i can add the body of the mail, but i want add to the complete email as an attachment.

TIA
  14-Sep-2005  03:21   
Another question when adding the mail body text into the task body, i want to use the original format (Rich text or whatever), i used .bodyFormat etc but it doesnt work
original text is display as non formatted text

tnx
  14-Sep-2005  09:42   
Ernst, take a look at the Attachments.Add method. See http://msdn.microsoft.com/library/en-us/off2000/html/olmthaddattachmentsobj.asp

See http://www.outlookcode.com/d/formatmsg.htm for information on the issues involved and solutions available for working with formatted text.
  24-Sep-2005  19:07   
Can you specify what you did to stop the security prompt from appearing in 2003. I have my own routine that works fine as a macro. But when I run it as part of a rule I get the message that is mentioned above by Bradley.
  27-Sep-2005  08:16   
Greg, the key to avoiding prompts in Outlook 2003 VBA is to make sure every object derives from the intrinsic Application object. That's why the sample above uses the Namespace.GetItemFromID method to return the item that triggered the rule.
  15-Dec-2005  08:04   
Hi,
If I wanted the .DueDate = olMail.SentOn + 1 day, do you know the code for this?

Thanks
Nathan
Page [ 1 2 3 4 5 6 7 8 9 10 Next >>  
Post your comment



name        email