in my VBA code ,I have following code to move a message to another folder.
Msg.Move objNS.Folders(2).Folders("foldername")
is suddenly pop up the error messages,did some debug,find out that we need change to following code now
Msg.Move objNS.Folders(1).Folders(13)
all index started with 1
objNS.Folders(1) is first folder in my outlook name space
objNS.Folders(1).Folders(13) is the 13th sub folder in previous folder,there is not method to get a sub folder by it's name,maybe a iteration will help to find the folder with specific name,but it is too heavy here,if we do not add new sub folder between first one and 13th,then we will be ok with previous code.
No comments:
Post a Comment