Outlook 2003 and TOleAuto... need some tips

Outlook 2003 and TOleAuto... need some tips

Postby Luis Krause » Tue May 15, 2007 8:04 pm

I need to do the following actions with Outlook 2003

1) When in the Composing a message window in Outlook, is there a way to intercept the To, CC, BBC buttons so that I can show the user a list of emails to pick from our own app instead of having Outlook show the address book?

2) From within a FWH app, is there a way to obtain Outlooks address book to allow a user to pick email addresses? (sort of the opposite of item 1).

Any useful links that have samples using Outlooks VBA coding?

Regards,

Luis Krause
"May the Source be with GNU"
User avatar
Luis Krause
 
Posts: 59
Joined: Tue Oct 11, 2005 1:39 am
Location: Vancouver, Canada

Re: Outlook 2003 and TOleAuto... need some tips

Postby Enrico Maria Giordano » Tue May 15, 2007 9:25 pm

For the 2):

Code: Select all  Expand view
#define olFolderContacts 10


FUNCTION MAIN()

    LOCAL oOutlook := CREATEOBJECT( "Outlook.Application" )
    LOCAL oNameSpace := oOutlook:GetNameSpace("MAPI")
    LOCAL oContacts := oNameSpace:GetDefaultFolder( olFolderContacts )

    LOCAL i

    SET DATE BRITISH

    FOR i = 1 TO oContacts:Items:Count
        ? oContacts:Items[ i ]:FullName
        ? oContacts:Items[ i ]:BusinessAddressStreet
        ? oContacts:Items[ i ]:BusinessAddressPostalCode
        ? oContacts:Items[ i ]:BusinessAddressCity
        ? oContacts:Items[ i ]:BusinessAddressState
        ? oContacts:Items[ i ]:BusinessAddressCountry
        ? oContacts:Items[ i ]:BusinessTelephoneNumber
        ? oContacts:Items[ i ]:Email1Address
        ? oContacts:Items[ i ]:LastModificationTime
        ?
        ? oContacts:Items[ i ]:Categories
        ?
    NEXT

    oOutlook:Quit()

    RETURN NIL


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Outlook 2003 and TOleAuto... need some tips

Postby Luis Krause » Wed May 16, 2007 4:33 pm

Enrico:

Excellent.. that gives me some other ideas.
Any clues for no 1)?

EnricoMaria wrote:For the 2):

EMG



Regards,

Luis Krause
"May the Source be with GNU"
User avatar
Luis Krause
 
Posts: 59
Joined: Tue Oct 11, 2005 1:39 am
Location: Vancouver, Canada

Re: Outlook 2003 and TOleAuto... need some tips

Postby Enrico Maria Giordano » Wed May 16, 2007 5:03 pm

No, sorry. You may search for OLE event handler.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby James Bott » Wed May 16, 2007 10:24 pm

Luis,

>1) When in the Composing a message window in Outlook, is there a way to intercept the To, CC, BBC buttons so that I can show the user a list of emails to pick from our own app instead of having Outlook show the address book?

You could do the whole message (including To, CC, BCC ) with a FWH dialog then just send the message via MAPI. This would give you complete control.

You could provide a list of contacts either from your own FW database or from the Outlook address book via the code Enrico provided.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 76 guests