Click here to Skip to main content
15,889,216 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
We have a VB.2010 program that can add contacts to outlook.

The program is that we cannot control which contact folder.

I noticed that there is an olContact.Account but it is not clear that that is. Putting the folder name (string) into it doesn't help.

The olContact save does not have any operands.

The SaveAs does not seem to work. SaveAs(pFolderName) does nothing that I can see. The intellisense as it should be the path but not sure what type of path. Putting in "Z:\Test\x.txt" does ave it to that file but is not what I want.

So how do I create a contact in a particular contracts folder?

What I have tried:

OlContact.Account = folder
Save()

SaveAs(Folder)

where folder = Contacts - email@email.com
Posted
Comments
MadMyche 21-Oct-18 12:27pm    
GetContactsFolder()
QuickBooksDev 22-Oct-18 6:21am    
How does GetContactsFolder help create a contact in a specific folder?

Where would I use it? In the OlContact? In the SaveAs?
MadMyche 22-Oct-18 9:35am    
Read the documentation for that method, its siblings, and its parents.
QuickBooksDev 22-Oct-18 14:01pm    
I did. Doesn't tell me much about what I need to do.

The AddressLists may give me folders but I still do not know how to set the folder when creating the contact. THe AddressLists.GetFolder does not even show all the folders in my contacts. I have 5 folders. AddressLists gives me a count of 4 and 2 for just 'contacts'.

Just doesn't add up for me.

Can you please give me a concrete example how to add a contact to different folders?


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900