Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
move message in Outlook
#1
does anyone know the code to move the currently selected or open message to a specific folder? i dont know where to start on msdn's site.

thanks.
#2
In Outlook 2003, youll find the help in the Outlook Help (not on the web). Look for "Microsoft Outlook Visual Basic Reference" in the table of contents.

Code:
Copy      Help
str foldername="TestFolder"

typelib Outlook {00062FFF-0000-0000-C000-000000000046} 9.2
Outlook.Application app._getactive

;get selected message
Outlook.MailItem msg=app.ActiveExplorer.Selection.Item(1); err out "no selection"; ret
;out msg.Subject

;get folder
Outlook.MAPIFolder froot=app.GetNamespace("MAPI").Folders.Item(1)
Outlook.MAPIFolder fdest=froot.Folders.Item(foldername)

;move
msg.Move(fdest)
#3
so, I'm looking back at my Outlook problems and found that after this month's MS updates for win7, my move macros may start to work again except that it sends my items to another folder in my Archive file rather than the folder on the exchange server.

does anyone know how I can specify the path as well?

Macro Archive Item in Outlook
Trigger CSAy 0x4     Help - how to add the trigger to the macro
Code:
Copy      Help
typelib Outlook {00062FFF-0000-0000-C000-000000000046} 9.4
str foldername="2013--Archive"
Outlook.Application app._getactive
Outlook.MailItem msg=app.ActiveExplorer.Selection.Item(1); err out "Error:Archive Item in Outlook";err 'D; ret
msg.UnRead=0
Outlook.MAPIFolder froot=app.GetNamespace("MAPI").Folders.Item(1)
Outlook.MAPIFolder fdest=froot.Folders.Item(foldername)
An old blog on QM coding and automation.

The Macro Hook


Forum Jump:


Users browsing this thread: 1 Guest(s)