PC Review


Reply
Thread Tools Rating: Thread Rating: 2 votes, 1.00 average.

Create Outlook Profiles via Script

 
 
kc2kth@arrl.net
Guest
Posts: n/a
 
      28th Jun 2007

Is anyone familiar with a method and the appropriate settings to
create an Outlook profile from a script? I'm looking for a way to
script creation of an Outlook profile specifying the mailbox (it will
not be the mailbox of the logged in user), then performing some tasks,
then removing the profile once complete. I need to loop through this
process for a large number of mailboxes - several thousand.

Client will be Outlook 2003 working against Exchange 2003 backend.

The goal is to create a specific folder for all mailboxes in the
Exchange organization.

Thanks in advance!

 
Reply With Quote
 
 
 
 
Sue Mosher [MVP-Outlook]
Guest
Posts: n/a
 
      28th Jun 2007
I'd use CDO 1.21 and dynamic profiles. Start at http://www.cdolive.com

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


<(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
>
> Is anyone familiar with a method and the appropriate settings to
> create an Outlook profile from a script? I'm looking for a way to
> script creation of an Outlook profile specifying the mailbox (it will
> not be the mailbox of the logged in user), then performing some tasks,
> then removing the profile once complete. I need to loop through this
> process for a large number of mailboxes - several thousand.
>
> Client will be Outlook 2003 working against Exchange 2003 backend.
>
> The goal is to create a specific folder for all mailboxes in the
> Exchange organization.
>
> Thanks in advance!
>

 
Reply With Quote
 
kc2kth@arrl.net
Guest
Posts: n/a
 
      29th Jun 2007
On Jun 28, 2:57 pm, "Sue Mosher [MVP-Outlook]"
<sue...@outlookcode.com> wrote:
> I'd use CDO 1.21 and dynamic profiles. Start athttp://www.cdolive.com
>
> --
> Sue Mosher, Outlook MVP
> Author of Microsoft Outlook 2007 Programming:
> Jumpstart for Power Users and Administrators
> http://www.outlookcode.com/article.aspx?id=54


Sue,

Found most of what I was looking for at that site. Thank you very
much!

I'm stuck on one concept however. I'm attempting to use the dynamic
profile option and login:

' Or, logon using an new MAPI session with a dynamically created
profile
strProfileInfo = "<Your Servername>" & vbLf & "<Your Mailbox>"
objSession.Logon "", "", False, True, 0, False, strProfileInfo

Plugging in the appropriate info for server name and mailbox, I'm
getting prompted to select one of my existing Outlook (2003, SP2)
profiles. Deleting those profiles and running the script again, I now
am prompted to create an Outlook profile.

I'm guessing something in the above code is not working. Unfortunately
I'm not sure where to look from here.

Prior to plugging in my own code into the sample code, I was able to
use the sample code to send an email from the correct profile. I can't
quite figure out why it worked to send an email, but now not when I
try to create a folder. My complete code is below:



 
Reply With Quote
 
kc2kth@arrl.net
Guest
Posts: n/a
 
      29th Jun 2007
On Jun 29, 12:22 pm, kc2...@arrl.net wrote:
> On Jun 28, 2:57 pm, "Sue Mosher [MVP-Outlook]"
>
> <sue...@outlookcode.com> wrote:
> > I'd use CDO 1.21 and dynamic profiles. Start athttp://www.cdolive.com

>
> > --
> > Sue Mosher, Outlook MVP
> > Author of Microsoft Outlook 2007 Programming:
> > Jumpstart for Power Users and Administrators
> > http://www.outlookcode.com/article.aspx?id=54

>
> Sue,
>
> Found most of what I was looking for at that site. Thank you very
> much!
>
> I'm stuck on one concept however. I'm attempting to use the dynamic
> profile option and login:
>
> ' Or, logon using an new MAPI session with a dynamically created
> profile
> strProfileInfo = "<Your Servername>" & vbLf & "<Your Mailbox>"
> objSession.Logon "", "", False, True, 0, False, strProfileInfo
>
> Plugging in the appropriate info for server name and mailbox, I'm
> getting prompted to select one of my existing Outlook (2003, SP2)
> profiles. Deleting those profiles and running the script again, I now
> am prompted to create an Outlook profile.
>
> I'm guessing something in the above code is not working. Unfortunately
> I'm not sure where to look from here.
>
> Prior to plugging in my own code into the sample code, I was able to
> use the sample code to send an email from the correct profile. I can't
> quite figure out why it worked to send an email, but now not when I
> try to create a folder. My complete code is below:


Hit send while trying to get back to my code. Here it is:

' Create MAPI session
Dim objSession
Set objSession = CreateObject("MAPI.Session")

' Or, logon using an new MAPI session with a dynamically created
profile
strProfileInfo = "server" & vbLf & "LeMay, John"
objSession.Logon "", "", False, True, 0, False, strProfileInfo


'********************************************************

SetupFolderHomePage "My Custom Folder","http://webserver"


Sub SetupFolderHomePage(foldername,url)
Set outApp=CreateObject("Outlook.Application")

Set nsp = outApp.GetNamespace("MAPI")
Set mpfInbox = nsp.GetDefaultFolder(6)
On Error Resume Next
Set mpfNew = mpfInbox.Parent.Folders.Add(foldername)
ErrMsg
mpfNew.WebViewURL = url
mpfNew.WebViewOn = True
End Sub

Sub ErrMsg
If err.number <> 0 then
wscript.echo "An Error has Occured"
wscript.echo "Most likely the folder already exists"
wscript.echo "Error Detail: "&Err.Number
Err.clear
end if

End Sub


'********************************************************

' Logoff from MAPI Session
objSession.Logoff

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create multiple Outlook profiles from script =?Utf-8?B?S2FyZW4=?= Microsoft Outlook Discussion 1 1st Mar 2007 06:41 PM
Automatic creation of Outlook/Exchange mail (MAPI) profiles script =?Utf-8?B?S2VsbHk=?= Microsoft Outlook VBA Programming 1 15th Nov 2006 03:47 PM
How do I setup outlook profiles using a Windows Login Script? =?Utf-8?B?TWlub3IgQWxmYXJv?= Microsoft Outlook Installation 3 7th Nov 2005 07:15 PM
outlook 2000 can't create new profiles news.rr.com Microsoft Outlook 2 1st Mar 2004 03:42 PM
How do I create two In-Boxes or Two profiles in Outlook AMT Microsoft Outlook 3 26th Feb 2004 11:52 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:14 AM.