Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to create cursor from object (GATHER NAME on steroid
Message
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01101568
Message ID:
01246790
Views:
22
>UPDATE. Didn't work with GetPem for some reason, but worked with EVALUATE and I got
>
>Address: && e-mail
>Application: (Object)
>Class: 8
>DisplayType: 0
>ID: 00000000C091ADD3519DCF11A4A900AA0047FAA4C200000000A65905F85A9ADF42B4559F0CAA9E02B004BF2300
>Manager: .NULL.
>Members: .NULL.
>Name: Adrián Hernández
>Parent: (Object)
>Session: (Object)
>Type: SMTP


Here is the code just in case:
lcStr = ""
#DEFINE CRLF CHR(13) + CHR(10)
oOA = CREATEOBJECT("Outlook.Application")
oNS = oOA.GetNamespace("MAPI")
* Get all available address lists
oALs = oNS.AddressLists()
* Get Global Address List
FOR lnI = 1 TO oALs.COUNT
	oGAL = oALs.ITEM[m.lnI] &&.Name    ("Global Address List")
* Get AddressEntries collection object
	oAEs = oGAL.AddressEntries
	FOR lnK = 1 TO oAEs.COUNT
		IF m.lnK = 1
			lnProps = AMEMBERS(laProps, 	oAEs.ITEM(1),  3)
		ENDIF
		FOR lnJ = 1 TO ALEN(laProps,1)
		     llOk = .t.
			IF  UPPER(laProps[m.lnJ,2])= UPPER("PropertyGet")
                       TRY
                           luVal = EVALUATE("oAEs.ITEM(m.lnK) ." + laProps[m.lnJ,1])&&Getpem(oAEs.ITEM(m.lnK),laProps[m.lnJ,1])
                         CATCH
                             llOk = .f.
                         endtry      
                         IF m.llOk
				lcStr  = m.lcStr +  laProps[m.lnJ,1] + ": " +  ;
				TRANSFORM(m.luVal) + CRLF
				endif
			ENDIF
		NEXT
	NEXT
NEXT
_CLIPTEXT = m.lcStr
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform