Link to home
Start Free TrialLog in
Avatar of MsSherryG
MsSherryGFlag for United States of America

asked on

Pull business card from Outlook Contact into Attachment (or OLE) field in Access with VBA

Due to 8 years of mis-managed contacts, I am trying to clean up a clients contacts.  There is no way I can see to do this (due to the mess it is in, over 5,000 contacts with wrong data in wrong fields, company names spelled differently in multiple contacts, etc.).  So I am trying to bring all his info into Access where I can 1) store a back-up of his contacts with all information, that I can easily manipulate 2) clean-up contacts and re-import into Outlook.

However, I do not know how to grab an attachment with a contact (ie: business card) and bring it into an access field set as either "attachment" or "OLE" (I am dealing with Access and Outlook 2010)
ASKER CERTIFIED SOLUTION
Avatar of Si Ball
Si Ball
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of MsSherryG

ASKER

Thanks Sudonim, I take a look at these links.  All I need to pull in is contact info, and I already have the code to pull  all the info into an access table, the only field I am having trouble with is bringing in the business card if there is one attached.  The plan is to completely reimport all contacts from Access once they are standardized and cleaned up, but he doesn't want to loose the business card attachment if there is one.  (some of his contacts came from him scanning in business cards, which then retains a copy of the card as an attachment to the contact.)

But again... thanks, I'll take a look at the code now.
Sudonim - Thanks for your assistance, unfortunately none of these links tell me what I need to know (although the second link is very handy as I can see a use for that in the future.)  So again, thanks but still not what I'm needing.
sorry i mssed that so these are cards as an attachement to the contact.

should be possible to iterate though contacts and check for attachments, then use whatever you currently use to export / import them.

in my outlook 2007 contacts view, a lot of my phone synched facebook cntacts have an attachment symbol which is their business card.

i wonder if the contact item treats the buscard as an attachment.

afraid i am out of my depth here then, we need a proper Outlook pro to crack this one :(

sorry

Sudonim.
No Problem Sudonim - Thanks for your help.  I've been trying several different syntax to grab attachment but it doesn't like any of them.
is there a way to loop through the properties of a contact and get the names?

like in access i would loop through a container / collection  like

dim dbs as database
set dbs = currentdb

dim tbl as tabledef
for each tbl in dbs.tabledefs
msgbox tbl.name
next

SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I ended up doing a work around.  I used the "saveasfile" outlook function to save the attachments to a file on my pc, and added a field in Access table that was marked as true if a file was saved for a certain contact.  I then looped back through recordset and used the loadfromfile method to pull the file back into the attachment field in my access table.

It wasn't pretty, but it got the job done.  Anyway, I now have a better grasp on how to load files into the multi-value fields (such as attachments) in Access 2010.

Sudonim - Thanks for your assistance.  Your information was useful and your time appreciated.