A
Albert
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 = systems@destination.aa
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
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 = systems@destination.aa
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