The Windows Address Book is common to all versions of Windows and can be used in conjuction with Outlook, Outlook Express and other email clients.
If you want to create a list of contacts and their email addresses for emailing or any other purpose, try the following :-
Make sure the Windows Address Book is available through Outlook, Outlook Express or other email client.
Alternatively, launch wab.exe via ShellExecute(), WSH or the RUN /N command.
In the .OLEDragDrop() event of a control, (.OleDropMode property of the control needs to be 1), of a VFP form, put :-
LOCAL aFiles ,; i,; lcCont_name,; lcEmail_Add,; lnRecNo
DO CASE CASE oDataObject.GETFORMAT(1) oDataObject.GETDATA(1,@aFiles) IF ALEN(aFiles) > 0 CREATE CURSOR MAILINGLIST (cont_name C(100), email_add C(254)) STRTOFILE(oDataObject.GETDATA(1),[C:\Temp\mailinglist.txt]) CREATE CURSOR EMAILADDRESSES (cline C(254)) APPEND FROM C:\Temp\mailinglist.txt SDF SCAN FOR ALLTRIM(EMAILADDRESSES.cline) = [E-mail Address(es):] lnRecNo = RECNO([EMAILADDRESSES]) GO lnRecNo - 1 lcCont_Name = ALLTRIM(EMAILADDRESSES.cline) GO lnRecNo + 1 lcEmail_add = ALLTRIM(EMAILADDRESSES.cline) INSERT INTO MAILINGLIST (cont_name, email_add) VALUES (lcCont_Name, lcEmail_Add) ENDSCAN USE IN EMAILADDRESSES ENDI ENDC
With both your VFP application and the Windows Address Book visible on the screen, all a user has to do it to select entries from the Windows Address Book, using SHIFT+CLICK, CTRL+CLICK or LEFT CLICK, and drag and drop them onto the VFP control.
To view the cursor put :-
SELECT MAILINGLIST BROWSE
wherever it suits after the above code block.
There are many more properties available using this technique other than simply the name and email address and include the 'Notes' attached to the contact.