Link to home
Start Free TrialLog in
Avatar of GMsb
GMsbFlag for Israel

asked on

How Can I progrematicly mail Enable a Public folder (VBS)

How Can I progrematicly set a PF to be mail Enabled?
(Prefered in VBS)

I know how to set a new folder


sMailInName="MyNewFolder"
set Application = CreateObject("Outlook.Application")
Set NameSpace = Application.GetNameSpace("MAPI")
Set oMailInTop = OpenMAPIFolder ("\Public Folders\All Public Folders\PutItUnderHere\AndHere")
Set MyNewFolder = oMailInTop.Folders.Add(sMailInName)

Now how do I also set it to be Mail-Enabled?
And how do I set Replication Topology

It all has to be done via Script
ASKER CERTIFIED SOLUTION
Avatar of David Wilhoit
David Wilhoit
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of GMsb

ASKER

It took me long time  but I made it
Thanks Kindo for the initial referal and the point I missed which was IT CAN'T run on WinXP only Win 2000 or 2003 SERVER.
 
Also I want to share some cool link to a manual: Introduction to the use of Exchange 2000 with WSH
http://activeanswers.compaq.com/aa_downloads/6/100/225/1/42365.pdf 

And here is the needed script

 Dim oMailRecipient
 Dim oMailingListFolder

sFolderName="My new Mail Enabled Folder"
sDescription = "Mail-In Automated:)"
Set oMailingListFolder = CreateObject("CDO.Folder")

   With oMailingListFolder
     .Description = sDescription
     .ContentClass = "urn:contact-classes:mailfolder"
     ' Save to the public store
     .DataSource.SaveTo "http://MyExhangeServer/public/subfolder\"& sFolderName
   End With
   ' Set the mail attributes
   Set oMailRecipient = oMailingListFolder.GetInterface ("IMailRecipient")
   oMailingListFolder.DataSource.Save  
   oMailRecipient.MailEnable
   oMailingListFolder.DataSource.Save