Eric
asked on
Edit outlook folder properties with a script
i CREATED a outlook folder using this script. i put it together based on a few different google searches. I know nothing about vb.
Now I just need to enable home page url and checkbox. of the home page tab in properties of this folder.
The path to do this manually is:
properties, home page tab, enter URL, click checkbox
Please help me finish this script. Maybe a check to see if the folder exists already and if it does terminate? That would be a nice touch.
Thanks
-------------------
Const olFolderInbox = 6
Set objOutlook = CreateObject("Outlook.Appl ication")
Set objNamespace = objOutlook.GetNamespace("M API")
Set objFolder = objNamespace.GetDefaultFol der(olFold erInbox)
Set objFolder = objFolder.Parent
Set objNewFolder = objFolder.Folders.Add(".Ar chive")
-------------------
Now I just need to enable home page url and checkbox. of the home page tab in properties of this folder.
The path to do this manually is:
properties, home page tab, enter URL, click checkbox
Please help me finish this script. Maybe a check to see if the folder exists already and if it does terminate? That would be a nice touch.
Thanks
-------------------
Const olFolderInbox = 6
Set objOutlook = CreateObject("Outlook.Appl
Set objNamespace = objOutlook.GetNamespace("M
Set objFolder = objNamespace.GetDefaultFol
Set objFolder = objFolder.Parent
Set objNewFolder = objFolder.Folders.Add(".Ar
-------------------
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
When you call CreateObject("Outlook.Appl ication") an instance of Outlook is executed if it is not opened.
I have used this but the problem is that once the folder is created and the script run again, it causes an error.
Is there anyway to add a line that says if folder already exists, do nothing?
Thanks in advance
Is there anyway to add a line that says if folder already exists, do nothing?
Thanks in advance
This will avoid the error. It will not run if the folder is already there. This will solve your problem.
Const olFolderInbox = 6
Set objOutlook = CreateObject("Outlook.Appl ication")
Set objNamespace = objOutlook.GetNamespace("M API")
Set objFolder = objNamespace.GetDefaultFol der(olFold erInbox)
Set objFolder = objFolder.Parent
on error resume next
Set objNewFolder = objFolder.Folders.Add("Arc hive")
objNewFolder.WebViewURL = "https://test.archive.webroot.co.uk/outlook/user"
objNewFolder.WebViewOn = True
Const olFolderInbox = 6
Set objOutlook = CreateObject("Outlook.Appl
Set objNamespace = objOutlook.GetNamespace("M
Set objFolder = objNamespace.GetDefaultFol
Set objFolder = objFolder.Parent
on error resume next
Set objNewFolder = objFolder.Folders.Add("Arc
objNewFolder.WebViewURL = "https://test.archive.webroot.co.uk/outlook/user"
objNewFolder.WebViewOn = True
ASKER
is it easy to add
-Check if folder exists, if it does quit.
Does outlook need to be open for this to work??