![]() |
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
|
|||
|
|||
![]()
I am using Access 2003, Outlook 2003, Exchange 2003
I am developing a simple Access CRM for our office. The DB uses a linked connection to Outlook/Public Folders/Address Book to populate the contacts table. To create new contacts, it seems easiest to simply open a new contact form to add the new contact. When I use the following code, it opens a new contact form for my personal contacts folder. I need it to open a new contact form for the Public Folders Address book. Here is the code I am using now: Sub StartOutLook_click() On Error GoTo StartOutLook_Error Dim spObj As Object, MyItem As Object ' Create a Microsoft OutLook object. Set spObj = CreateObject("Outlook.Application") ' Create and open new contact form for input. Set MyItem = spObj.CreateItem(olContactItem) MyItem.Display ' Quit Microsoft Outlook. Set spObj = Nothing Exit Sub StartOutLook_Error: MsgBox "Error: " & Err & " " & Error Exit Sub End Sub ************************** I have also tried this code where I have gotten the ID for the Address Book I want to use: ************************** Private Sub PubFolderContact() Dim olfolder As Outlook.mapiFolder Dim olapp As Outlook.Application Dim MyItem As Object Set olapp = CreateObject("Outlook.Application") Set olfolder = olapp.GetNamespace("Mapi").GetFolderFromID("000000 001A447390AA6611CD9BC800AA002FC45A030082A9113B53F5 E344B7226F2A7489F43100000009A8BD0000") Set MyItem = olapp.CreateItem(olContactItem) MyItem.Display Set olfolder = Nothing Set olapp = Nothing End Sub ***************** This code also only opens the Personal Contacts form. Please advise on how to open a Public Folders/Address Book contact form. |
#2
|
|||
|
|||
![]()
To create a new instance of a custom form programmatically, use the Add method on the target folder's Items collection:
Set newItem = targetFolder.Items.Add("IPM.Post.YourFormName") You can use the code at http://www.outlookcode.com/d/code/getfolder.htm to walk the folder hierarchy and return the MAPIFolder corresponding to a given path string. -- 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 "mmattson" wrote in message ... I am using Access 2003, Outlook 2003, Exchange 2003 I am developing a simple Access CRM for our office. The DB uses a linked connection to Outlook/Public Folders/Address Book to populate the contacts table. To create new contacts, it seems easiest to simply open a new contact form to add the new contact. When I use the following code, it opens a new contact form for my personal contacts folder. I need it to open a new contact form for the Public Folders Address book. Here is the code I am using now: Sub StartOutLook_click() On Error GoTo StartOutLook_Error Dim spObj As Object, MyItem As Object ' Create a Microsoft OutLook object. Set spObj = CreateObject("Outlook.Application") ' Create and open new contact form for input. Set MyItem = spObj.CreateItem(olContactItem) MyItem.Display ' Quit Microsoft Outlook. Set spObj = Nothing Exit Sub StartOutLook_Error: MsgBox "Error: " & Err & " " & Error Exit Sub End Sub ************************** I have also tried this code where I have gotten the ID for the Address Book I want to use: ************************** Private Sub PubFolderContact() Dim olfolder As Outlook.mapiFolder Dim olapp As Outlook.Application Dim MyItem As Object Set olapp = CreateObject("Outlook.Application") Set olfolder = olapp.GetNamespace("Mapi").GetFolderFromID("000000 001A447390AA6611CD9BC800AA002FC45A030082A9113B53F5 E344B7226F2A7489F43100000009A8BD0000") Set MyItem = olapp.CreateItem(olContactItem) MyItem.Display Set olfolder = Nothing Set olapp = Nothing End Sub ***************** This code also only opens the Personal Contacts form. Please advise on how to open a Public Folders/Address Book contact form. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
What happens if multiple users update a contact stored in public folders? | [email protected] | Outlook - Using Forms | 1 | March 30th 06 03:18 PM |
VBA shortcut to open custom form in design mode? | Burma Jones | Outlook and VBA | 4 | March 30th 06 11:37 AM |
Too many Find Public Folders dialogs open | JJSPROUT | Outlook - Using Contacts | 1 | March 22nd 06 07:35 AM |
Searching a contact folder created in Public Folders fails. | Ben McKellar | Outlook - Using Contacts | 0 | March 12th 06 10:26 PM |
VBA shortcut to open custom form in design mode? | Burma Jones | Outlook - Using Forms | 2 | March 6th 06 07:17 PM |