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

How do I move a message to a folder after forwarding ?



 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old December 5th 09, 04:40 PM posted to microsoft.public.outlook.program_vba
Albert[_4_]
external usenet poster
 
Posts: 3
Default How do I move a message to a folder after forwarding ?

I am forwarding a message then after sending want to move it to the TRUVO
folder. Can someone help, what have I done wrong ??

thanks .. Alb

Sub ForwardHome()
Rem forward a highlighted email to the email address nominated
Rem to work correctly the Function GetCurrentItem() must also be included
Dim ObjMail As Outlook.MailItem
Set objItem = GetCurrentItem()
Set ObjMail = objItem.Forward
ObjMail.To =
ObjMail.Send
Set objItem = Nothing
Set ObjMail = Nothing

Rem this first part works okay !

Rem now next bit should move highlighted email to nominated folder
"Personal folders/TRUVO" after being sent
Set oInboxItems = bjNS.GetDefaultFolder(olFolder"Personal folders").Items
Set olns = Item.Application.GetNamespace("MAPI")
Set objTargetFolder = Outlook.Session.PickFolder
Set objCurItem = oInboxItems.Item(1)
Set objCurItem = objCurItem.Move(objTRUVO)

End Sub

Function GetCurrentItem() As Object
Dim objApp As Outlook.Application
Set objApp = Application
On Error Resume Next
Select Case TypeName(objApp.ActiveWindow)
Case "Explorer"
Set GetCurrentItem = objApp.ActiveExplorer.Selection.Item(1)
Case "Inspector"
Set GetCurrentItem = objApp.ActiveInspector.CurrentItem
Case Else
End Select
End Function




 




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
Outlook 2003 Forwarding Rule forwarding only one message of batch Diane Poremsky [MVP] Outlook - General Queries 0 June 23rd 09 12:27 AM
Outlook 2003 Forwarding Rule forwarding only one message of batch Brian Tillman [MVP - Outlook] Outlook - General Queries 0 June 22nd 09 07:16 PM
Outlook 2003 Forwarding Rule forwarding only one message of batch David[_14_] Outlook - General Queries 0 June 11th 09 03:54 PM
move original message after replying or forwarding rengland Add-ins for Outlook 1 February 5th 07 06:02 AM
Using VBA code to move current message to a folder Dean Outlook and VBA 4 February 26th 06 01:46 AM


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