Customer wants to pre-seed his Outlook contacts with a CSV list to save him time later when actually emailing these people for the first time.
Haven't dove into this yet but wanted to throw it out to the group in case someone has already "been there, done that, here's the plan."
tia! --Mike
I've done stuff with good old COM automation and the Lookout contact object. And it was probably based on stuff I read in the Hentzenwerke COM automation book. But I'm happy to go look for it and let you know more details.
--
rk
-----Original Message----- From: ProfoxTech profoxtech-bounces@leafe.com On Behalf Of MB Software Solutions, LLC Sent: Wednesday, May 27, 2020 4:03 PM To: profoxtech@leafe.com Subject: Populating Microsoft Outlook address book using a list of emails from a CSV file
Customer wants to pre-seed his Outlook contacts with a CSV list to save him time later when actually emailing these people for the first time.
Haven't dove into this yet but wanted to throw it out to the group in case someone has already "been there, done that, here's the plan."
tia! --Mike
[excessive quoting removed by server]
It's a CSV file, is it a onetime thing? Use Outlook to import it. Otherwise use COM automation. Tracy
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Richard Kaye Sent: Wednesday, May 27, 2020 4:10 PM To: profoxtech@leafe.com Subject: RE: Populating Microsoft Outlook address book using a list of emails from a CSV file
I've done stuff with good old COM automation and the Lookout contact object. And it was probably based on stuff I read in the Hentzenwerke COM automation book. But I'm happy to go look for it and let you know more details.
--
rk
-----Original Message----- From: ProfoxTech profoxtech-bounces@leafe.com On Behalf Of MB Software Solutions, LLC Sent: Wednesday, May 27, 2020 4:03 PM To: profoxtech@leafe.com Subject: Populating Microsoft Outlook address book using a list of emails from a CSV file
Customer wants to pre-seed his Outlook contacts with a CSV list to save him time later when actually emailing these people for the first time.
Haven't dove into this yet but wanted to throw it out to the group in case someone has already "been there, done that, here's the plan."
tia! --Mike
[excessive quoting removed by server]
So I rooted around in my toolkit and I found a few things that I wrote to manipulate my own Lookout contacts, folders and categories. This one was a template I used for doing some cleanup and updates existing contacts.
*!* UpdateContacts.prg * Read Outlook contact information various objects #DEFINE olContacts 10 #DEFINE olNone 0 #DEFINE olHome 1 #DEFINE olBusiness 2 #DEFINE olOther 3
*!* DECLARE object variables LOCAL oNameSpace as Object, oContacts as Object, ; oContact as Object, oItems as Object
*!* DECLARE memvars to hold outlook property values LOCAL cFirst as String, cLast as String, cAddr as String, cPhone as String, ; cCompany as String, cEmail1Address as String
IF VARTYPE(oOutlook) = [O] * Remove any existing object reference to Outlook oOutlook=null RELEASE oOutlook ENDIF oOutlook = CREATEOBJECT("Outlook.Application") oNameSpace = oOutlook.GetNameSpace("MAPI") * Get Contacts folder oContacts = oNameSpace.GetDefaultFolder( olContacts ) * Go through contacts *!* CREATE filter string to ignore distribution lists LOCAL cFilter as String, lSaveIt as Boolean cFilter = "[Message Class] <> 'IPM.DistList'" oItems=oContacts.Items.Restrict( cFilter ) *!* cFilter = "[Categories] = 'your category to filter on'" FOR EACH oContact IN oItems lSaveIt=.f. WITH oContact *!* SET the filter, if any, for updating here IF ['your category to filter on]$LOWER(.Categories) IF VARTYPE(.FirstName)=[C] cFirst = .FirstName ELSE cFirst = [] ENDIF IF VARTYPE(.LastName)=[C] cLast = .LastName ELSE cLast = [] ENDIF IF VARTYPE(.PrimaryTelephoneNumber)=[C] cPhone = .PrimaryTelephoneNumber ELSE cPhone = [] ENDIF IF VARTYPE(.CompanyName)=[C] cCompany = .CompanyName ELSE cCompany = [] ENDIF IF VARTYPE(.Email1Address)=[C] cEmail1Address = .Email1Address ELSE cEmail1Address = [] ENDIF categories = .Categories IF VARTYPE(.BusinessAddress)=[C] cAddr = .BusinessAddress ELSE cAddr = [] ENDIF *!* ADD variables for different outlook properties here. IF EMPTY(cCompany) .CompanyName=[the company name to add to all these contacts] lSaveIt=.t. ENDIF IF EMPTY(cPhone) .PrimaryTelephoneNumber=[the phone number to add to all these contacts] IF NOT lSaveIt lSaveIt=.t. ENDIF ENDIF IF NOT [@]$cEmail1Address .Email1Address=ALLTRIM(.Email1Address)+[@company.com] IF NOT lSaveIt lSaveIt=.t. ENDIF ENDIF IF EMPTY(cAddr) .BusinessAddress=[One Company Address]+CHR(13)+[New York City, NY 10001] IF NOT lSaveIt lSaveIt=.t. ENDIF ENDIF ENDIF IF lSaveIt && updated at least one thing .Save ENDIF ENDWITH ENDFOR RETURN
--
rk
-----Original Message----- From: ProfoxTech profoxtech-bounces@leafe.com On Behalf Of Richard Kaye Sent: Wednesday, May 27, 2020 4:10 PM To: profoxtech@leafe.com Subject: RE: Populating Microsoft Outlook address book using a list of emails from a CSV file
I've done stuff with good old COM automation and the Lookout contact object. And it was probably based on stuff I read in the Hentzenwerke COM automation book. But I'm happy to go look for it and let you know more details.
--
rk
-----Original Message----- From: ProfoxTech profoxtech-bounces@leafe.com On Behalf Of MB Software Solutions, LLC Sent: Wednesday, May 27, 2020 4:03 PM To: profoxtech@leafe.com Subject: Populating Microsoft Outlook address book using a list of emails from a CSV file
Customer wants to pre-seed his Outlook contacts with a CSV list to save him time later when actually emailing these people for the first time.
Haven't dove into this yet but wanted to throw it out to the group in case someone has already "been there, done that, here's the plan."
tia! --Mike
[excessive quoting removed by server]
Can you import a list cab style still? I use to do it back in the day.
On Wed, May 27, 2020 at 3:03 PM MB Software Solutions, LLC < mbsoftwaresolutions@mbsoftwaresolutions.com> wrote:
Customer wants to pre-seed his Outlook contacts with a CSV list to save him time later when actually emailing these people for the first time.
Haven't dove into this yet but wanted to throw it out to the group in case someone has already "been there, done that, here's the plan."
tia! --Mike
[excessive quoting removed by server]