Accessing folder 'Other Contacts'

I am programming in VBA

Several users are using Outlook in a network environment. Each of them hat 
its own 'Contacts'. They have shared their addresslists so that I can lookup 
en change the contacts fields from my workstation.

I would like to access these Contactlists by using VBA. Therefor, i found 
via the help function some code and tried to open the contact of a user 
called 'DE DAUW' and whose contacts I can see in the 'Other Contacts'. 
Impossible to get into the 'DE DAUW' addresslist. 

Who can help me ?

    Dim MyApp As Outlook.Application
    Dim MyNameSpace As Outlook.Namespace
    Dim MyFolder As Outlook.MAPIFolder
    Dim MyItemsCollection As Object
    Dim myItem As Object
    Dim MyMatchingItem As Object
    Dim myNewFolder  As Outlook.MAPIFolder
    Dim myAddressLists As AddressLists
    Dim myAddressList As AddressList

    Set MyApp = CreateObject("Outlook.Application")
    Set MyNameSpace = MyApp.GetNamespace("MAPI")
    MyNameSpace.Logon

    Set MyFolder = MyNameSpace.GetDefaultFolder(olFolderContacts)
    Set myNewFolder = 
MyNameSpace.GetDefaultFolder(olFolderContacts).Folders(1)
    Set myAddressLists = MyNameSpace.AddressLists("DE DAUW")

    Debug.Print
    Debug.Print "MyfolderPath:" & myNewFolder.FolderPath
    Debug.Print "Myfolder:" & MyFolder.Name, "MyNewFolder:" & myNewFolder.Name
0
Utf
5/6/2010 11:58:01 AM
outlook.program_vba 490 articles. 0 followers. Follow

1 Replies
752 Views

Similar Articles

[PageSpeed] 42

Look at the Namespace.GetSharedDefaultFolder method.

-- 
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy  - Outlook, CDO
and MAPI Developer Tool
-
"Rudy" <Rudy@discussions.microsoft.com> wrote in message 
news:8AED479E-22F6-44A3-A695-77107E1DA0CC@microsoft.com...
>I am programming in VBA
>
> Several users are using Outlook in a network environment. Each of them hat
> its own 'Contacts'. They have shared their addresslists so that I can 
> lookup
> en change the contacts fields from my workstation.
>
> I would like to access these Contactlists by using VBA. Therefor, i found
> via the help function some code and tried to open the contact of a user
> called 'DE DAUW' and whose contacts I can see in the 'Other Contacts'.
> Impossible to get into the 'DE DAUW' addresslist.
>
> Who can help me ?
>
>    Dim MyApp As Outlook.Application
>    Dim MyNameSpace As Outlook.Namespace
>    Dim MyFolder As Outlook.MAPIFolder
>    Dim MyItemsCollection As Object
>    Dim myItem As Object
>    Dim MyMatchingItem As Object
>    Dim myNewFolder  As Outlook.MAPIFolder
>    Dim myAddressLists As AddressLists
>    Dim myAddressList As AddressList
>
>    Set MyApp = CreateObject("Outlook.Application")
>    Set MyNameSpace = MyApp.GetNamespace("MAPI")
>    MyNameSpace.Logon
>
>    Set MyFolder = MyNameSpace.GetDefaultFolder(olFolderContacts)
>    Set myNewFolder =
> MyNameSpace.GetDefaultFolder(olFolderContacts).Folders(1)
>    Set myAddressLists = MyNameSpace.AddressLists("DE DAUW")
>
>    Debug.Print
>    Debug.Print "MyfolderPath:" & myNewFolder.FolderPath
>    Debug.Print "Myfolder:" & MyFolder.Name, "MyNewFolder:" & 
> myNewFolder.Name 


0
Dmitry
5/6/2010 5:51:13 PM
Reply:

Similar Artilces:

transferring contacts and folders from Outlook
Hello I am new to Windows mail. How do I move contacts and folders across - 'Help' has been of no help. Thanks Ric If you really mean Outlook (not Outlook Express): Outlook stores messages in a .pst file. Windows Mail cannot import from a ..pst file unless Outlook is installed on the Vista computer. 1. Install Outlook on your new computer Copy the .pst file to the new computer Open the .pst file with Outlook. In Windows Mail, File - Import - Messages - Microsoft Outlook For contacts: Open Outlook. File - Import and Export... - Export to a file - Comma Separate...

Windows Explorer folders open "very slowly"
Hello NG I'm sorry for this off-topic article, but I think this group has a lot of experts even in this field. After visiting "hacker" sites my computer behaves very bad. If I doubleclick a folder on the desktop it takes 10 seconds to respond. The system tries to do something via internet meanwhile, because if I uplug the network cable, the folders open immediately. It must be some virus which has altered some settings and did other bad things to my system. Has anyone experience with this kind of symptoms? Thanx Richie Stop visiting "hacker" sites. :) AliR. "...

Vanishing Clipboard from preview pane to contact
When I try to copy date from my preview pane in outlook, and then open a contact to past the new data into it, there is nothing to paste. I have to open the blkank contact, re-copy the information, and then paste it into the blank contact. Is this some setting that I have missed in Outlook 2003, or is this a ig that will be fixed? it's caused by an addin - Mappoint addin is one, but any addin that adds buttons to the contact form can cause this problem. http://www.slipstick.com/contacts/clipboard.htm -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours...

Project web Access is missing
One user claims to have deleted a workspase / Library and now the PWA configuration is missing from the server. We have the database on a SQL box and when recreate the PWA project states "The database specified is already used by another project server. Enter a different server or database name and try again. " Sounds like you should be posting in the Project Server newsgroup. This is the desktop tool discussion group. "C.M." wrote: > One user claims to have deleted a workspase / Library and now the PWA > configuration is missing from the server. ...

External access to New Message Count?
I am trying to tie my outlook into the houses home automation system I am ruining outlook 2007. The home automation system is running on ANOTHER computer on our trusted network. What I would like to do is POLL my computer for the number of NEW messages in outlook. If outlook was NOT running, I would poll the POP3 server, but it would return the raw count, spam and all, which routinely run in the hundreds. I leave outlook running so that it gathers my email from several servers, de-spams it, and sorts it into several folders. I would like to just get the TOTAL via a external qwery if...

Groups in Contacts
Can I group several contacts under a common name? Like ABC Company and then 4 or 5 contacts under the same roof. Not necessarily with different job descriptions. RS Yes. Create a new 'Distribution List' from with Contacts and add existing Contacts to the DL. -- Regards. Chris. Remove MAPSON to reply to me directly. This post represents the views of the author and does not necessarily accurately represent the views of BT. "TCEBob" <tcebobc@comcast.net> wrote in message news:#7xjSr0VDHA.1816@TK2MSFTNGP09.phx.gbl... > Can I group several contacts under a common...

Cannot save folders
When I create a new folder I cannot save it to the Shortcut Bar. I get the following message: **Outlook could not save the updated folder shortcut information. Check to make sure there is sufficient disk space and that the file "C:\Documents and Settings\Jack\Application Data\Microsoft\Outlook" is not marked read-only. Another attempt to save will be made after the next change or when you exit. You don't have appropriate permission to perform this operation.** The above mentioned folder IS marked read-only but each time I change it, it reverts back to read-only. I am signed ...

Restore Deleted Outlook XP folder
Can I restore a deleted outlook folder? It's possible if you simply deleted it and haven't compacted the file. For info on this please contact me directly. I run a small outfit that provides recovery services for situations like yours. Kevin Sidell outlook@sidell.net www.sidell.net/outlook "Wanda" <anonymous@discussions.microsoft.com> wrote in message news:052501c39e96$50abdf70$a601280a@phx.gbl... > Can I restore a deleted outlook folder? ...

Private Folder problems on Exchange 2000
Can anyone help with this strange behaviour of Exchange 2000 on Windows 2000 server, clients using Outlook 2000. System boots and Exchange Server runs but on two users (UserA, UserB) on opening Outlook the Outlook Today folder is not expanded and if clicked to expand an error message UNABLE TO EXPAND THE FOLDER APPEARS. Both users can see full information if Web Access is used. In UserB's case he cannot open his list at all but UserA sees all his folders beginning with the letters A and B. UserA has approx. 300 folders and UserB has approx. 500 Additionally there has been an ongoing p...

How do I Export range of row/column data to Access
DESCRIPTION OF CURRENT SITUATION: I have an Excel file that my field techs enter data and print customer reports from. The file contains multiple sheets. The field techs enter data into sheet1. They print a report in Sheet2 which uses the data in Sheet1. Before the next job, I have a routine that the techs invoke that clears the input sheet (Sheet1) and saves the data into a row/column format in Sheet3 (some of the data in these fields are in paragragh format). QUESTION: I want to export the range of data in the row/column format in Sheet3 to a file that can be easily imported into...

Patch Folders
Windows Server 2003 R2 with SP2 + the latest patches. This is an AD controller. Would it be ok to manually delete the following folders? C:\WINDOWS\$hf_mig$ (about 990MB) C:\WINDOWS\$NtServicePackUninstall$ (about 500 MB) C:\WINDOWS\$NtUninstallKB******$ (total of 400+ MB, where ****** = KB number) I'd like to gain 2GB of free space on my C volume. The free space on C volume is currently at 800MB. If I delete and purge them, will there be any problem (assuming that I don't want to uninstall patches)? Thanks in advance. Hello John" a, You should keep...

To read the files from a particular folder
Hi, I want to read some file names within a particular folder . How do i do it.Is there any API for that. "lucky" <Laxmanmaruthy@gmail.com> wrote: >Hi, > >I want to read some file names within a particular folder . How do i do >it.Is there any API for that. You want to browse through the files in a folder? Look at the CFileFind class (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcmfc98/html/_mfc_Class_Library_Reference_Introduction.asp) -- Tim Slattery MS MVP(DTS) Slattery_T@bls.gov http://members.cox.net/slatteryt ...

data access page error, OLE server isn't registered
I have a data access page that displays information in my access 2003 database. It has worked for 5 years or more but recently one computer I use stopped working. It still works on others. I thought I would overcome this by replaceing that PC but this new windows 7 PC with Office 2003 freshly installed and updated gives the same error. I think I have eleminated network and permissions issues as a copy of the database saved to the desktop of the new PC runs OK. However, if I try and make a new data access page it says "The OLE server isn't registered". Any ...

RODC prepopulate passwords and now access denied on shares
I recently configured PRP for a branch site and immediately prepopulated passwords for all users for that site. Bizarrely users at this site could not access shares on a local file server, getting access denied. This only happened after i prepopulated their passwords as before they could access the shares ok. After a bit of troubleshooting it looked like anyone who authenticated against the branch site RODC were getting access denied when accessing shares. Users who were authenticating against a hub DC could access the shares fine. I decided to remove the allowed groups from the...

outlook web access #31
What's is wrong when you receive mail 3days later using Microsoft outook web access OWA is just an HTML mail client, really. Check with your Exchange administrator and the sender. The problem is between the servers somewhere. Beverly Anderson wrote: > What's is wrong when you receive mail 3days later using > Microsoft outook web access ...

Saving to a Server Folder
I want to be able to set up a rule whereby I can cc: certain messages to a folder that resides outside of Outlook. I want to cc: the emssage to a folder on our server. You can't do this through the Rule Wizard. Is this at all possible? Thanks! ...

Auto table name change in Access queries
Do anyone know how to disable automatic table name change in Accessqueries?Currently, I am testing a set of 30 queries in an Access database andneed to have these 30 queries run on different tables, for example,tblA, tblB, and tblC. I have all 30 queries built using tblA. Iwanted to test the data in tblB, so I renamed tblA to tblA_BK and tblBto tblA. However, when I ran the queries, some queries are referringto tblA but some are referring to tblA_BK. Why it that? How toprovent this from happening?Thank you in advanced for your help.- Grasshopper - That is done by Name AutoCorrect, which i...

How can I assign a category for a new contact
The new outlook 2007 does not have a button to assign a Category? how can I assig a category for a recent new contact open? Yes it does. It's the big Categorize button in the Options group on the = "ribbon." --=20 Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for=20 Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx =20 "Outlook 2007" <Outlook 2007@discussions.microsoft.com> wrote in message...

Data Migration
Hi, I am looking for some best advice and tool on migrating data from MS Access to CRM. I.e. whether I should use CDF or Import on the MS CRM Tools menu. Access Tables: - Customers: Contain lookup tables i.e. drop down box to select the following: * State/Province * Country * Customer Type * Customre Subtype * Resellers * Subresellers - Contacts - Relationships: 1 customer to many contacts CRM Tables: - Account - Contacts The desired result for the CRM tables after the data migration process is being able to maintain the relationships i.e. 1 Account to many contacts (Is ...

Business Contact Manager's contact question?
Hi, Why isn't there any link between Outlook's Contact and BCM's Business Contact? Outlook's Contact is more detailed information I'd liked to use but BCM's Business Contact have cool features e.g. report, so why don't MS integrate them in same one? Thanks, ...

Access 2003 Question
How do I get the "statusbar text" to display in a form? It displays on the Status Bar when the control has the focus and the Status Bar is turned on. Where do you want to display the data on your form? dpee wrote: >How do I get the "statusbar text" to display in a form? -- RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP WinXP Pro Please post back to this forum so all may benefit. Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/200801/1 What is it you exactly want? You can place text in the description of...

SQL command to count Contacts
I read in the CRM documentation that to find out how many total Contacts are in the CRM database, that I have to select all Active Records and then export them all to Excel in order to count how many records were found in total. But surely, this can be done using an SQL statement (count function?) in SQL Query Analyzer. Has anyone figured out the exact SQL command needed ? Jim jim.halpenny@eurofound.eu.int a =E9crit : > I read in the CRM documentation that to find out how many total > Contacts are in the CRM database, that I have to select all Active > Records and then export them...

outlook Add-In problem accessing shared calendar second time
Hi I had developed an Add - In for outlook 2003. It works fine while accessing the inbox folder. But when I tried to access the mail item stored in the calendar of another user, it works fine for the first time. When I opened the mail Item in the calendar for the second time it says "The operation Failed" error message. I think the error is generated in the line "Inspector.CurrentItem" when the application tries to get the reference of the active inspector Regards R.Balamurugan You would have to show more of your code for anyone to see what you are doing and how. ...

Office SP3 Access 2003
Has anyone else seen this problem - occurs on many machines (20) after Office 2003 SP3 install yesterday - completely killed the application. (These are XP machines). Selected Forms open OK but on close get the MS screen of death - 'Access has experienced a problem and needs to close- do you want to backup database, repair it and restart Access' . Repairing does not fix anything. The only common thread is all the forms have one or more drop downs. Also occurs in selected reports where a drop down control was placed by the Access Report designer. These same forms/reports canno...

Copy file to debug folder
Hi, In my project i have a text file that is required by my application. I have included it in the project, but the file is not copied to the debug folder in the solution when i build. I have set the "deployable content" for the file, but still it is not copied to the output directory during the build. In C#, setting this flag copies the file during build. How do i do this in an MFC project? J Have you tried copying it doing a post build step in the project settings? Tom "JoeB" <joe@nospam.com> wrote in message news:eO%23saKk4GHA.2596@TK2MSFTNGP06.phx.g...