LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 661
Default Macro to move item to a folder

I was able to piece together from this groups help a macro that will copy an
item into a folder and them move the item to a 2nd folder. I know this is a
stupid question, but I need a macro that just moves item to a folder. So I
would think all I need to do is remove some of the lines from my current
macro, but I cannot figure out which one. All I want to do is move the items
in ObjFolder1.

If I could get some guidance on how to do this it would be greatly
appreciated.

Sub W7X80201()
Dim obj As Object
Dim I As Long
Dim Sel As Selection

Dim objFolder As Outlook.MAPIFolder
Dim objFolder1 As Outlook.MAPIFolder
Dim objInbox As Outlook.MAPIFolder
Dim objInbox1 As Outlook.MAPIFolder
Dim objNS As Outlook.NameSpace
Dim objNS1 As Outlook.NameSpace

Set objNS = Application.GetNamespace("MAPI")
Set objNS1 = Application.GetNamespace("MAPI")

'Assume these are mail folders
Set objInbox = objNS.GetDefaultFolder(olFolderInbox)
Set objFolder = objInbox.Folders("Projects").Folders("City of
Scottsdale").Folders("W7X80201 - Airport - Seal Coat")
Set objInbox1 = objNS1.GetDefaultFolder(olPublicFoldersAllPublicFo lders)
Set objFolder1 =
objNS1.GetDefaultFolder(olPublicFoldersAllPublicFo lders).Folders("Phoenix").Folders("Jobs").Folders( "NAI").Folders("W7X80201 - Airport - Seal Coat")

Set Sel = Application.ActiveExplorer.Selection
For I = Sel.Count To 1 Step -1
Set obj = Sel(I)
Select Case True
Case (TypeOf obj Is Outlook.MailItem), (TypeOf obj Is
Outlook.ReportItem)
Set objCopy = obj.Copy
obj.Move objFolder
objCopy.Move objFolder1
End Select
Next
End Sub
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to ask for a item# and then show all details for that item Durai Excel Discussion (Misc queries) 5 December 4th 09 08:17 PM
VBA Macro - Loop through folder and move files to other folders hurlbut777 Excel Programming 9 December 5th 08 05:30 PM
Move Files from Folder to Folder THE_RAMONES Excel Programming 2 May 25th 06 09:23 PM
How do I save an embedded item from a worksheet into a folder Alan Excel Programming 2 November 24th 04 09:04 PM
Move them to different folder Prasad Vanka Excel Programming 2 May 21st 04 01:50 PM


All times are GMT +1. The time now is 08:38 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"