Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with Outlook?
Message
From
30/04/2024 15:47:50
 
 
To
30/04/2024 13:58:31
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01687959
Message ID:
01687962
Views:
42
>Hello all,
>
>I execute this code. First time I execute everything's fine. Second time my application hangs and I have to reboot my computer. I guess that there could be something related to outlook still in memory. But I don't understand.
>
>
>
>lContinue = .F.
>
>oOutlook = CREATEOBJECT("Outlook.Application")
>outlookAccounts = oOutlook.GetNamespace("MAPI").Accounts
>FOR i = 1 TO outlookAccounts.Count
>    IF outlookAccounts.Item(i).DisplayName = "myemail@mycompany.com" THEN
>		lContinue = .T.
>        EXIT
>    ENDIF
>ENDFOR
>oOutlook = null 
>outlookAccounts = null
>
>IF !lContinue
>	Messagebox( "You can't use that application.")
>	QUIT
>ENDIF 
>
You must release the variables in reverse order.
It's also recommended to use Release to absolutely make sure that the variables are released.
IOW
outlookAccounts = null
outlook = null
release outlookAccounts && recommended 
release outlook && recommended
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform