Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with Outlook?
Message
From
02/05/2024 02:35:08
 
 
To
01/05/2024 15:58:38
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01687959
Message ID:
01687971
Views:
34
>Hello Tore,
>
>Here is the revised code.
>
>
>lContinuer = .F.
>oOutlook = CREATEOBJECT("Outlook.Application")
>IF VARTYPE( oOutlook) = "U"
>	DO FORM ts_Messagebox WITH I("Outlook must be running")
>	oOutlook = null
>	RELEASE oOutlook	
>	QUIT 
>ELSE 
>	oMapi = oOutlook.GetNamespace("MAPI")
>	outlookAccounts = oMapi.Accounts
>	FOR i = 1 TO outlookAccounts.Count
>	    IF outlookAccounts.Item(i).DisplayName = "anemail@mycompany.com" THEN
>			lContinuer = .T.
>	        EXIT
>	    ENDIF
>	ENDFOR
>	outlookAccounts = null
>	RELEASE outlookAccounts
>	oMAPI = null
>	RELEASE oMAPI
>
>	IF !lContinuer
>		DO FORM ts_Messagebox WITH I("You can't use the application.")
>		oOutlook = null
>		RELEASE oOutlook	
>		quit
>	ENDIF 
>ENDIF 
>oOutlook = null
>RELEASE oOutlook	
>
Could there be a variable scoping issue? Is there any difference if you explicitly declare them LOCAL/PRIVATE and/or mdot them?
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Previous
Reply
Map
View

Click here to load this message in the networking platform