Import files into outlook

cura

New Member
Hello everybody,

I was wondering if it was possible to automatically import Excell or .txt or .csv files into outlook by a Progress code.
I need to import contacts that have been saved into a file into Progress.

Manually importing the fields 1 by 1 isn't really an option since we suspect the new Outlook 2003 security changes prevent doing this (with some kind of buffer or something).

Does anybody know if it is possible or not to do this? That would help me alot so I know I can search further on this solution.
And if anybody knows how that'd be just perfect.

Or maybe somebody has had experience with adding contact persons into outlook 2003(!) and knows another solution?
Somebody mentioned me that it is possible to send mails to somewhere in Exchange and this automatically inputs the contacts aswell, but I didn't find anything to confirm this. If this is possible, to which adress are you supposed to send it and in which format does your mail have to be?
Cause with SMTP this would be a good solution aswell.

thanks in advance,
cura
 

cura

New Member
more into the matter of sending a message to the exchange adress:
apparently it is possible to set the message type to "IPM.Contact", if I can just find out how this has to be done and can be combined with the smtpmail program everybody (I hope) knows there wouldn't be a problem anymore ;)
 
cura said:
Hello everybody,

I was wondering if it was possible to automatically import Excell or .txt or .csv files into outlook by a Progress code.
I need to import contacts that have been saved into a file into Progress.

I'm not sure about automatically doing it in Progress, but I recently had to export an address book from CC Mail into Outlook 2000. The same principles should apply.

I created a dummy contact in Outlook, then used the export facility to export it to a CSV file. I then checked where the fields were in the CSV file. Then I wrote a very simple routine to import the addresses from CCMail, add any required fields and export it to a CSV file in the same format as the dummy one. Finally, I manually imported the file into Outlook.

I had to do it twice, the first time showed me which required fields were missing.

cura said:
Manually importing the fields 1 by 1 isn't really an option since we suspect the new Outlook 2003 security changes prevent doing this (with some kind of buffer or something).

Doesn't Outlook 2003 have an import/export function, the same as Outlook 97 or 2000?

Simon
 

WillieG

New Member
What about importing the csv file and then use com objects to create the contacts in outlook. The following example code will create a contact in outlook. I'm using MS Office 2000, but I'm sure it will work on 2003.
def var hout as com-handle.
def var hitem as com-handle.
create "outlook.application" hout.
hitem = hout:createitem(2). /* olContactItem = 2 */
hitem:FullName = "Who Ever".
hitem:Email1Address = "whoever@hiswebsite.com".
NO-RETURN-VALUE hitem:close(0). /* Close & Save = 0 */
RELEASE OBJECT hitem.
RELEASE OBJECT hout.
 

cura

New Member
it@flude.co.uk said:
Doesn't Outlook 2003 have an import/export function, the same as Outlook 97 or 2000?
it does, but the code has to be run at night without use interference, so it has to work through a progress code

WillieG said:
What about importing the csv file and then use com objects to create the contacts in outlook. The following example code will create a contact in outlook. I'm using MS Office 2000, but I'm sure it will work on 2003.
def var hout as com-handle.
def var hitem as com-handle.
create "outlook.application" hout.
hitem = hout:createitem(2). /* olContactItem = 2 */
hitem:FullName = "Who Ever".
hitem:Email1Address = "whoever@hiswebsite.com".
NO-RETURN-VALUE hitem:close(0). /* Close & Save = 0 */
RELEASE OBJECT hitem.
RELEASE OBJECT hout.
thx, this code helped me alot, wasn't quite what I meant but it helped alot anyway ;)
I read them from the database and added them like that, the previous errors I got seem to have been the "buffer" of the com-handles that got overflowed and refused service ^^
 

TomScott

New Member
Where could I find a list of other ways to reach out to outlook. Say instead of a contact I wanted to create an email itself, and then instead of fields such as fullname and email, there would be cc,bcc,etc. I've tried other methods of this, ex. os-command, but I run into issues with the body itself. It'm attempting to integrate a CRM program with outlook. For example, I would have multiple letters, in some common format, and then by choosing one and clicking a button, it would preformat an email to be ready to send or even send it from within a progress program. Any ideas.

Thanks alot, been trying to figure this out for some time.
 

Rob Fitzpatrick

ProgressTalk.com Sponsor
I would suggest that you start with the Microsoft Outlook developer documentation on MSDN, in particular the MAPI reference and the Outlook Object Model reference, so you have an understanding of the extensibility options available to you. Also look at the Progress documentation library for the Programming Interfaces manual, which documents the use of COM automation in OpenEdge ABL.

In PRO*Tools you will find an applet called the COM Object Viewer (proobjvw.exe in $DLC\bin) that allows you to look at type libraries and inspect the various objects' methods, properties, and events. For example, my Outlook 2010 type library is in C:\Program Files\Microsoft Office\Office14\MSOUTL.OLB.

Also, if you want boilerplate e-mails, look into Outlook message templates.

And as mentioned earlier in this thread, note that you may have to work around Outlook security settings if you are programmatically generating contacts or e-mail messages.
 
Top