![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
![]()
Hello everyone,
I am a sales engineer and I send by email offers. I already coded my VBA for Outlook in order to generate automatically a remainder 10 days after that I send an offer. Now, I would like to move this email with my offer attached to a folder "offers following". How Can i do this, right know I have the following in my code: For Each PJ In Item.Attachments If Left(PJ.FileName, 5) = "Offer" Then MsgBox "OK" Set myOlApp = CreateObject("Outlook.Application") Set myApptItem = myOlApp.CreateItem(olAppointmentItem) myApptItem.Start = Now + 10 myApptItem.End = Now + 10.015 myApptItem.Subject = Item.Subject myApptItem.Save Exit For Thanks a lot! |
#2
|
|||
|
|||
![]()
On Thu, 24 Jan 2008 03:42:00 -0800, Thierry wrote in microsoft.public.outlook.program_vba:
I am a sales engineer and I send by email offers. I already coded my VBA for Outlook in order to generate automatically a remainder 10 days after that I send an offer. Now, I would like to move this email with my offer attached to a folder "offers following". How Can i do this, right know I have the following in my code: For Each PJ In Item.Attachments If Left(PJ.FileName, 5) = "Offer" Then MsgBox "OK" Set myOlApp = CreateObject("Outlook.Application") Set myApptItem = myOlApp.CreateItem(olAppointmentItem) myApptItem.Start = Now + 10 myApptItem.End = Now + 10.015 myApptItem.Subject = Item.Subject myApptItem.Save Exit For Have you tried: Item.Move(GetNamespace("MAPI").GetDefaultFolder(ol FolderInbox).Folders("offers following")) BTW, I'm not sure you need this code: Set myOlApp = CreateObject("Outlook.Application") Set myApptItem = myOlApp.CreateItem(olAppointmentItem) IMO, this could be written (in an OLProject): ' Set myOlApp = CreateObject("Outlook.Application") ' not needed Set myApptItem = CreateItem(olAppointmentItem) -- Michael Bednarek http://mbednarek.com/ "POST NO BILLS" -- Michael Bednarek http://mbednarek.com/ "POST NO BILLS" |
#3
|
|||
|
|||
![]()
thank you Micheal,
You post was very helpfull, I had to add: Set myCopiedItem = Item.Copy myCopiedItem.Move GetNamespace("MAPI").GetDefaultFolder(olFolderInbo x).Folders("offers following") it works pretty good, i am all set! Bye "Michael Bednarek" wrote: On Thu, 24 Jan 2008 03:42:00 -0800, Thierry wrote in microsoft.public.outlook.program_vba: I am a sales engineer and I send by email offers. I already coded my VBA for Outlook in order to generate automatically a remainder 10 days after that I send an offer. Now, I would like to move this email with my offer attached to a folder "offers following". How Can i do this, right know I have the following in my code: For Each PJ In Item.Attachments If Left(PJ.FileName, 5) = "Offer" Then MsgBox "OK" Set myOlApp = CreateObject("Outlook.Application") Set myApptItem = myOlApp.CreateItem(olAppointmentItem) myApptItem.Start = Now + 10 myApptItem.End = Now + 10.015 myApptItem.Subject = Item.Subject myApptItem.Save Exit For Have you tried: Item.Move(GetNamespace("MAPI").GetDefaultFolder(ol FolderInbox).Folders("offers following")) BTW, I'm not sure you need this code: Set myOlApp = CreateObject("Outlook.Application") Set myApptItem = myOlApp.CreateItem(olAppointmentItem) IMO, this could be written (in an OLProject): ' Set myOlApp = CreateObject("Outlook.Application") ' not needed Set myApptItem = CreateItem(olAppointmentItem) -- Michael Bednarek http://mbednarek.com/ "POST NO BILLS" -- Michael Bednarek http://mbednarek.com/ "POST NO BILLS" |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
move attached email to another folder | paul | Outlook - General Queries | 2 | July 5th 07 03:20 AM |
Auto-move to Junk Email folder | Jeff | Outlook - General Queries | 3 | May 7th 07 07:43 PM |
move an email to a folder after sending | Zangel_xyz | Outlook and VBA | 0 | February 19th 07 05:10 PM |
2 simple macros - create task from email and move email to folder | [email protected] | Outlook and VBA | 5 | February 4th 07 10:57 AM |
move contact email from one distribution folder to another | herasmomma | Outlook - Using Contacts | 3 | April 20th 06 11:55 AM |