P
pete the greek
hi all, im trying to work out how to move folders using vba, i have manged to
move emails to new folders but cant move folders
we use public folders at work and the one i have to drag and drop to is
buried some 10 levels down for the odd move this is no problem but at times i
could be doing 20-30
my problems are
how do you identify the current folder
and then how do you move it
this is what i have so far
myfolder being the one im trying to move
objfolder being the destination
im playing with this on my personal pc hence the required path is not so long
Sub foldermove()
Set objNS = Application.GetNamespace("MAPI")
Set myFolder = objNS.Folders.Item("personal folders").Folders.Item("ongoing
orders for uk").Folders.Item(1)
objfolder = objNS.Folders.Item("personal folders").Folders.Item("inbox")
myFolder.Move (objfolder)
End Sub
move emails to new folders but cant move folders
we use public folders at work and the one i have to drag and drop to is
buried some 10 levels down for the odd move this is no problem but at times i
could be doing 20-30
my problems are
how do you identify the current folder
and then how do you move it
this is what i have so far
myfolder being the one im trying to move
objfolder being the destination
im playing with this on my personal pc hence the required path is not so long
Sub foldermove()
Set objNS = Application.GetNamespace("MAPI")
Set myFolder = objNS.Folders.Item("personal folders").Folders.Item("ongoing
orders for uk").Folders.Item(1)
objfolder = objNS.Folders.Item("personal folders").Folders.Item("inbox")
myFolder.Move (objfolder)
End Sub