Solved

Edit outlook folder properties with a script

Posted on 2009-07-07
5
802 Views
Last Modified: 2013-11-10
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.Application")
Set objNamespace = objOutlook.GetNamespace("MAPI")
Set objFolder = objNamespace.GetDefaultFolder(olFolderInbox)
Set objFolder = objFolder.Parent
Set objNewFolder = objFolder.Folders.Add(".Archive")
-------------------
0
Comment
Question by:Eric
  • 2
  • 2
5 Comments
 
LVL 11

Accepted Solution

by:
dougaug earned 500 total points
ID: 24797156
To setup the properties you mentioned above, add the following code to your script:

  objNewFolder.WebViewURL = "http://www.experts-exchange.com"
  objNewFolder.WebViewOn = True

I hope this help,

Douglas
0
 
LVL 11

Author Comment

by:Eric
ID: 24807878
This worked perfectly.
is it easy to add
-Check if folder exists, if it does quit.

Does outlook need to be open for this to work??

0
 
LVL 11

Expert Comment

by:dougaug
ID: 24808585
When you call CreateObject("Outlook.Application") an instance of Outlook is executed if it is not opened.

0
 

Expert Comment

by:deckydee
ID: 36179371
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
0
 

Expert Comment

by:deckydee
ID: 36180582
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.Application")
Set objNamespace = objOutlook.GetNamespace("MAPI")
Set objFolder = objNamespace.GetDefaultFolder(olFolderInbox)
Set objFolder = objFolder.Parent
on error resume next
Set objNewFolder = objFolder.Folders.Add("Archive")
objNewFolder.WebViewURL = "https://test.archive.webroot.co.uk/outlook/user"
objNewFolder.WebViewOn = True
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now