I am a little unclear on the following point. When an Office object is created from VFP or even VB, such as an Outlook item, eg:
olApp = CreateObject("Outlook.Application") && Outlook object
olNameSpace = olApp.GetNameSpace("MAPI") && Namespace object
oEvent = olApp.CreateItem(1) && An appointment item
oEvent.display && Show it
After the item is displayed, the code continues to execute since there is no mechanism to pause it. So if the variables are Local and the method/procedure ends, or I set the item object to null:
oEvent = Null
the Outlook object item still remains happily displayed and active and can be manipulated by the user as desired. The question is, is this an acceptable/appropriate way to handle this, or should some variable/property that does not go out of scope be used to hold the object. Even so, there is no way ( that I know of ) to know when the user has finished doing what they do with the created item that it might then be "destroyed". But there is something unsettling to me about the object variable going out of scope or otherwise being "destroyed" while the item that was created chugs merrily on its way and I just forget about it.
Am I missing something here? I realize this may be reasonably vague as my thoughts are somewhat muddled on the issue and I would welcome explanations/comments/questions for clarification concerning it.
Thanks,
Bill
William A. Caton III
Software Engineer
MAXIMUS
Atlanta, Ga.