Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Outlook and forms
Message
From
13/02/2004 22:18:38
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00877277
Message ID:
00877349
Views:
17
Hi Steve.

Is is possible to create an Oulook form, like a contact form, using VFP automation?

Sure. Use code like this to populate a cursor from the contacts folder in Outlook:
*** And create a cursor to display the contacts
CREATE CURSOR csrContacts (;
  	    cLast C( 30 ), ;
	    cFirst C( 20 ), ;
	    cAddress C( 100 ), ;
	    cDisplayName C( 100 ) )

#DEFINE olFolderContacts	10	
#DEFINE olContact	          40	

*** Get a reference to the contacts folder
loOutlook = CREATEOBJECT( 'Outlook.Application' )
loNameSpace = loOutlook.GetNameSpace( 'MAPI' )
loAddressBook = loNameSpace.GetDefaultFolder( olFolderContacts )
IF VARTYPE( loAddressBook ) = 'O'
  *** Get info about each contact into the array
  FOR EACH loContact IN loAddressBook.Items
    WITH loContact
      *** Make sure we only get individual contacts
      *** and skip any distribution lists
      IF .Class = olContact
        INSERT INTO csrContacts ( cLast, cFirst, cAddress, cDisplayName ) VALUES ;
	( .LastName, .FirstName, .Email1Address, .FullName )
      ENDIF
    ENDWITH
  ENDFOR
ENDIF
Then all you need to do is use this cursor as the RecordSource for a grid and let the user pick the contact from the grid.

Too bad we didn't get the chance to meet you this week. Andy and I spoke at the San Diego Fox user group yesterday....
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform