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

Move to a folder my sending email



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old January 24th 08, 12:42 PM posted to microsoft.public.outlook.program_vba
thierry
external usenet poster
 
Posts: 3
Default Move to a folder my sending email

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  
Old January 24th 08, 02:27 PM posted to microsoft.public.outlook.program_vba
Michael Bednarek
external usenet poster
 
Posts: 6
Default Move to a folder my sending email

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  
Old January 24th 08, 03:37 PM posted to microsoft.public.outlook.program_vba
thierry
external usenet poster
 
Posts: 3
Default Move to a folder my sending email

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
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
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


All times are GMT +1. The time now is 10:19 AM.


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.