![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
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 06:08 PM |
"Show this folder as an email address book" | Sherry in MI | Outlook - Using Contacts | 4 | May 11th 06 11:35 AM |
Show Contact folder as an Address Book | Lamar | Outlook - Installation | 1 | April 21st 06 07: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 04:14 PM |
Can't select "show this folder as an e-mail address book" | Michael Blaut | Outlook - Using Contacts | 5 | February 12th 06 04:22 PM |