FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Outlook 2003 and TOleAuto... need some tips
Posts: 59
Joined: Tue Oct 11, 2005 01:39 AM
Outlook 2003 and TOleAuto... need some tips
Posted: Tue May 15, 2007 08: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"
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Outlook 2003 and TOleAuto... need some tips
Posted: Tue May 15, 2007 09:25 PM
For the 2):

#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
Posts: 59
Joined: Tue Oct 11, 2005 01:39 AM
Re: Outlook 2003 and TOleAuto... need some tips
Posted: Wed May 16, 2007 04: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"
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Outlook 2003 and TOleAuto... need some tips
Posted: Wed May 16, 2007 05:03 PM

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

EMG

Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Outlook 2003 and TOleAuto... need some tips
Posted: 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

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10

Continue the discussion