Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP9 compiler
Message
From
01/05/2024 13:02:13
 
 
To
01/05/2024 09:46:57
General information
Forum:
Visual FoxPro
Category:
Third party products
Title:
Miscellaneous
Thread ID:
01687432
Message ID:
01687966
Views:
63
>Hi Tore,
>
>Thanks for the reply but I still have the same problem
>
>Here is the revised code
>
>
>lcontinue = .F.
>oOutlook = CREATEOBJECT("Outlook.Application")
>IF VARTYPE( oOutlook) = "U"
>	Messagebox( "Outlook must be running")
>	oOutlook = null
>	RELEASE oOutlook	
>	QUIT 
>ELSE 
>	outlookAccounts = oOutlook.GetNamespace("MAPI").Accounts
>	FOR i = 1 TO outlookAccounts.Count
>	    IF outlookAccounts.Item(i).DisplayName = "SomeEmail@mybusiness.com" THEN
>			lcontinue = .T.
>	        EXIT
>	    ENDIF
>	ENDFOR
>	outlookAccounts = null
>	RELEASE outlookAccounts
>
>	IF !lcontinue
>		Messagebox( "You can't use the application.")
>		oOutlook = null
>		RELEASE oOutlook	
>		quit
>	ENDIF 
>ENDIF 
>oOutlook = null
>RELEASE oOutlook	
>
>

No idea whether this will make a difference, but my experience is that you should always instantiate the MAPI object before instantiating any of its members. So maybe try:
oMapi = oOutlook.GetNamespace("MAPI")
outlookAccounts = oMapi.Accounts
Tamar
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform