A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook - Using Contacts
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

activate contact folder from public folder with "show this folder as email address book using a prf file



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old July 24th 06, 01:11 PM posted to microsoft.public.outlook.contacts
Frankie K.
external usenet poster
 
Posts: 4
Default activate contact folder from public folder with "show this folder as email address book using a prf file

Hi,

i setup the mapi user profiles with a prf file, but i don't know a way
to activate to of my contact folder from my public folders for usage as
email address book.

I saw the following posting
http://groups.google.de/group/micros...a69054 caac72

but there are no specific instructions how i have to configure my
outlook.

I hope someone can help me.

Thank you in advance!

Best regards,
Frankie

Ads
  #2  
Old July 24th 06, 02:35 PM posted to microsoft.public.outlook.contacts
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default activate contact folder from public folder with "show this folder as email address book using a prf file

That is not a setting you can manage with a .prf file. Each user would need to run a script to set the ShowAsOutlookAB property for the folder to True.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Frankie K." wrote in message ups.com...
Hi,

i setup the mapi user profiles with a prf file, but i don't know a way
to activate to of my contact folder from my public folders for usage as
email address book.

I saw the following posting
http://groups.google.de/group/micros...a69054 caac72

but there are no specific instructions how i have to configure my
outlook.

I hope someone can help me.

Thank you in advance!

Best regards,
Frankie

  #3  
Old July 24th 06, 07:08 PM posted to microsoft.public.outlook.contacts
Frankie K.
external usenet poster
 
Posts: 4
Default activate contact folder from public folder with "show this folder as email address book using a prf file

Thank you Sue,

i tested the following:

Sub ShowAsAddressBookChange()

Dim olApp As Outlook.Application
Dim nmsName As Outlook.NameSpace
Dim fldFolder As Outlook.MAPIFolder

Set olApp = Outlook.Application
'Create instance of namespace
Set nmsName = olApp.GetNamespace("Mapi")
Set fldFolder = nmsName.GetDefaultFolder(olFolderContacts)
'Display the folder as Outlook Address Book
fldFolder.ShowAsOutlookAB = True

End Sub

Works fine! But how can i set the path to my contact folder in my
public folder. Which objet can i use to set this path?

Thank you in advance!

Best regards,
Frank

Sue Mosher [MVP-Outlook] schrieb:

That is not a setting you can manage with a .prf file. Each user would need to run a script to set the ShowAsOutlookAB property for the folder to True.


  #4  
Old July 24th 06, 07:55 PM posted to microsoft.public.outlook.contacts
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default activate contact folder from public folder with "show this folder as email address book using a prf file

To get a non-default folder, you need to walk the folder hierarchy starting with the Namespace.Folders collection or use a function that does that for you. See http://www.outlookcode.com/d/code/getfolder.htm and, especially for public folders, http://www.outlookcode.com/codedetail.aspx?id=1164

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Frankie K." wrote in message ps.com...
Thank you Sue,

i tested the following:

Sub ShowAsAddressBookChange()

Dim olApp As Outlook.Application
Dim nmsName As Outlook.NameSpace
Dim fldFolder As Outlook.MAPIFolder

Set olApp = Outlook.Application
'Create instance of namespace
Set nmsName = olApp.GetNamespace("Mapi")
Set fldFolder = nmsName.GetDefaultFolder(olFolderContacts)
'Display the folder as Outlook Address Book
fldFolder.ShowAsOutlookAB = True

End Sub

Works fine! But how can i set the path to my contact folder in my
public folder. Which objet can i use to set this path?

Thank you in advance!

Best regards,
Frank

Sue Mosher [MVP-Outlook] schrieb:

That is not a setting you can manage with a .prf file. Each user would need to run a script to set the ShowAsOutlookAB property for the folder to True.


  #5  
Old July 24th 06, 09:48 PM posted to microsoft.public.outlook.contacts
Frankie K.
external usenet poster
 
Posts: 4
Default activate contact folder from public folder with "show this folder as email address book using a prf file

Hi Sue,

if I run the code in Visual Editor it's ok but if i test it with a
double click as a vbs script i get Error 800A0401 line:2 character: 15

Can you help me once more, please?

Sub ShowAsAddressBookChange()
Dim olApp As Outlook.Application
Dim nmsName As Outlook.NameSpace
Dim fldFolder As Outlook.MAPIFolder

Set olApp = Outlook.Application
'Create instance of namespace
Set nmsName = olApp.GetNamespace("Mapi")
'Set fldFolder = GetFolder("Public Folders/All Public
Folders/Company/Sales")
'objNS.GetDefaultFolder(olFolderContacts)
Set fldFolder = GetFolder("Test")
'Display the folder as Outlook Address Book
fldFolder.ShowAsOutlookAB = True
End Sub

Public Function GetFolder(strFolderPath As String) As MAPIFolder
' folder path needs to be something like
' "Public Folders\All Public Folders\Company\Sales"
Dim objApp As Outlook.Application
Dim objNS As Outlook.NameSpace
Dim colFolders As Outlook.Folders
Dim objFolder As Outlook.MAPIFolder
Dim arrFolders() As String
Dim I As Long
On Error Resume Next
strFolderPath = Replace(strFolderPath, "/", "\")
arrFolders() = Split(strFolderPath, "\")
Set objApp = CreateObject("Outlook.Application")
Set objNS = objApp.GetNamespace("MAPI")
Set objFolder = objNS.Folders.Item(arrFolders(0))
If Not objFolder Is Nothing Then
For I = 1 To UBound(arrFolders)
Set colFolders = objFolder.Folders
Set objFolder = Nothing
Set objFolder = colFolders.Item(arrFolders(I))
If objFolder Is Nothing Then
Exit For
End If
Next
End If
Set GetFolder = objFolder
Set colFolders = Nothing
Set objNS = Nothing
Set objApp = Nothing
End Function

Best regards
Frank

  #6  
Old July 24th 06, 10:03 PM posted to microsoft.public.outlook.contacts
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default activate contact folder from public folder with "show this folder as email address book using a prf file

The VBScript language doesn't support data-typed variable declarations. Comment out all the ' As clauses and use CreateObject("Outlook.Application") to return an Outlook.Application object.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Frankie K." wrote in message ups.com...
Hi Sue,

if I run the code in Visual Editor it's ok but if i test it with a
double click as a vbs script i get Error 800A0401 line:2 character: 15

Can you help me once more, please?

Sub ShowAsAddressBookChange()
Dim olApp As Outlook.Application
Dim nmsName As Outlook.NameSpace
Dim fldFolder As Outlook.MAPIFolder

Set olApp = Outlook.Application
'Create instance of namespace
Set nmsName = olApp.GetNamespace("Mapi")
'Set fldFolder = GetFolder("Public Folders/All Public
Folders/Company/Sales")
'objNS.GetDefaultFolder(olFolderContacts)
Set fldFolder = GetFolder("Test")
'Display the folder as Outlook Address Book
fldFolder.ShowAsOutlookAB = True
End Sub

Public Function GetFolder(strFolderPath As String) As MAPIFolder
' folder path needs to be something like
' "Public Folders\All Public Folders\Company\Sales"
Dim objApp As Outlook.Application
Dim objNS As Outlook.NameSpace
Dim colFolders As Outlook.Folders
Dim objFolder As Outlook.MAPIFolder
Dim arrFolders() As String
Dim I As Long
On Error Resume Next
strFolderPath = Replace(strFolderPath, "/", "\")
arrFolders() = Split(strFolderPath, "\")
Set objApp = CreateObject("Outlook.Application")
Set objNS = objApp.GetNamespace("MAPI")
Set objFolder = objNS.Folders.Item(arrFolders(0))
If Not objFolder Is Nothing Then
For I = 1 To UBound(arrFolders)
Set colFolders = objFolder.Folders
Set objFolder = Nothing
Set objFolder = colFolders.Item(arrFolders(I))
If objFolder Is Nothing Then
Exit For
End If
Next
End If
Set GetFolder = objFolder
Set colFolders = Nothing
Set objNS = Nothing
Set objApp = Nothing
End Function

Best regards
Frank

  #7  
Old July 25th 06, 04:26 PM posted to microsoft.public.outlook.contacts
Frankie K.
external usenet poster
 
Posts: 4
Default activate contact folder from public folder with "show this folder as email address book using a prf file

Hi Sue,

sorry for asking once more but i am not really familiar with VBS.
I used CreateObject as suggested by you but how do i have to adapt your
following code for VBS:

Public Function GetFolder(strFolderPath As String) As MAPIFolder
' folder path needs to be something like
' "Public Folders\All Public Folders\Company\Sales"
Dim objApp As Outlook.Application
Dim objNS As Outlook.NameSpace
Dim colFolders As Outlook.Folders
Dim objFolder As Outlook.MAPIFolder
Dim arrFolders() As String
Dim I As Long
On Error Resume Next
strFolderPath = Replace(strFolderPath, "/", "\")
arrFolders() = Split(strFolderPath, "\")
Set objApp = CreateObject("Outlook.Application")
Set objNS = objApp.GetNamespace("MAPI")
Set objFolder = objNS.Folders.Item(arrFolders(0))
If Not objFolder Is Nothing Then
For I = 1 To UBound(arrFolders)
Set colFolders = objFolder.Folders
Set objFolder = Nothing
Set objFolder = colFolders.Item(arrFolders(I))
If objFolder Is Nothing Then
Exit For
End If
Next
End If
Set GetFolder = objFolder
Set colFolders = Nothing
Set objNS = Nothing
Set objApp = Nothing
End Function

Thanks in advance.

Best regards,
Frank

Sue Mosher [MVP-Outlook] schrieb:

The VBScript language doesn't support data-typed variable declarations. Comment out all the ' As clauses and use CreateObject("Outlook.Application") to return an Outlook.Application object.


  #8  
Old July 25th 06, 05:37 PM posted to microsoft.public.outlook.contacts
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default activate contact folder from public folder with "show this folder as email address book using a prf file

You already did:

Set objApp = CreateObject("Outlook.Application")
Set objNS = objApp.GetNamespace("MAPI")

but you still need to get rid of all those As data/object type expressions, which are not supported in VBScript.
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Frankie K." wrote in message ups.com...
Hi Sue,

sorry for asking once more but i am not really familiar with VBS.
I used CreateObject as suggested by you but how do i have to adapt your
following code for VBS:

Public Function GetFolder(strFolderPath As String) As MAPIFolder
' folder path needs to be something like
' "Public Folders\All Public Folders\Company\Sales"
Dim objApp As Outlook.Application
Dim objNS As Outlook.NameSpace
Dim colFolders As Outlook.Folders
Dim objFolder As Outlook.MAPIFolder
Dim arrFolders() As String
Dim I As Long
On Error Resume Next
strFolderPath = Replace(strFolderPath, "/", "\")
arrFolders() = Split(strFolderPath, "\")
Set objApp = CreateObject("Outlook.Application")
Set objNS = objApp.GetNamespace("MAPI")
Set objFolder = objNS.Folders.Item(arrFolders(0))
If Not objFolder Is Nothing Then
For I = 1 To UBound(arrFolders)
Set colFolders = objFolder.Folders
Set objFolder = Nothing
Set objFolder = colFolders.Item(arrFolders(I))
If objFolder Is Nothing Then
Exit For
End If
Next
End If
Set GetFolder = objFolder
Set colFolders = Nothing
Set objNS = Nothing
Set objApp = Nothing
End Function

Thanks in advance.

Best regards,
Frank

Sue Mosher [MVP-Outlook] schrieb:

The VBScript language doesn't support data-typed variable declarations. Comment out all the ' As clauses and use CreateObject("Outlook.Application") to return an Outlook.Application object.


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
"Show this folder as an e-mail Address Book" is dimmed Bryan L Outlook - General Queries 3 May 31st 06 05:08 PM
"Show this folder as an email address book" Sherry in MI Outlook - Using Contacts 4 May 11th 06 10:35 AM
Show Contact folder as an Address Book Lamar Outlook - Installation 1 April 21st 06 06:59 PM
Checking all contacts subfolders to "Show this folder as an e-mail address book" S. Johnson Outlook - Using Contacts 1 March 20th 06 03:14 PM
Can't select "show this folder as an e-mail address book" Michael Blaut Outlook - Using Contacts 5 February 12th 06 03:22 PM


All times are GMT +1. The time now is 08:31 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2024 Outlook Banter.
The comments are property of their posters.