WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

OLE and Outlook
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Rename Personal Folder in Oulook


Question:

I just got my Winbatch and I look it, not got one question?..

I am trying to rename my personal folder in outlook client into old personal Foloder.

For example.
Manually I will do the following steps.

Right click on personal folders, then point to properties “personal folder” Then Click on Advance Tab in personal folder properties Windows Then Change the name in the Name fields form “personal folders” to “old personal folders”

Any help will be appreciated.

Answer:

; Winbatch Version: 2005B -- Script by Jay Alverson
;   this works on my Outlook 2000, however there's
;   a catch. I'm not online so my top level isn't
;   like "Mailbox - Joe Blow" but rather is called
;   "Personal Folders" since I'm offline.
;   substitute whatever shows on your Mailbox's top level display
;
;   I'm using Winbatch 2005B and Outlook 2000...

objOutlook = ObjectOpen("Outlook.Application")
oln = objOutlook.GetNameSpace("MAPI")
oln.logon("", "", 0, 1)

MainFolder = oln.Folders.item("Personal Folders") ;<-- top level folder...
LevelOneFolders = MainFolder.folders              ;<-- subfolders underneath it...

FolderToRename = LevelOneFolders.item("TheNewFolder")  ;<-- a subfolder I just added...
FolderToRename.name = "TheRenamedFolder"               ;<-- rename it...

;clean up
FolderToRename = 0
oln = 0
objOutlook = 0
Exit

Article ID:   W17133
File Created: 2007:07:03:14:28:26
Last Updated: 2007:07:03:14:28:26