J
Jeff Mowatt
I'm trying to find a way to get around a minor problem with an application
which is opened within
my custom form. It's a custom application I developed and I therefore have
control of the
modal/nonmodal settings of the windows used within it.
Here's a simplified code example:
Function MyButton_Click()
set myApp = createobject("MyAutoServer.Application")
'Open a modal or non modal window until window is closed and new record
stored
MyApp.Show()
nresult=MyApp.GetResultKey()
mylistbox.list=Myapp.RecordArray(nresult)
End Function
This application presents a window and allows me to store records in an
SQLServer database.
When the data has been stored and the window has been closed, I can retrieve
the record
content from SQL passing it as a listbox array back to Outlook. My custom
form will then be
able to display the contents.
Everything works perfectly if I make MyApp.Show() a modal window but the one
problem is that
the window is iconized.
I can get around this problem by making the window non modal and forcing the
window to show by
effectively showing it twice.
Unfortunately, now that it's non modal Outlook doesn't wait for my
application to complete
and attempts to show the results before they have been stored.
Ideally I'd like to find a way to force a modal window over the top of the
Outlook form,
it can be done once the window has been opened for the first time.
Otherwise I could get around this new problem with a non modal window if
there was a way to force
an event such that I could notify completion of the database activity with
the event handler then
firing off the code to display the results in my listbox.
Could anyone suggest a way forward? A complete rewrite is not out of the
question:-(
TIA
Jeff Mowatt
which is opened within
my custom form. It's a custom application I developed and I therefore have
control of the
modal/nonmodal settings of the windows used within it.
Here's a simplified code example:
Function MyButton_Click()
set myApp = createobject("MyAutoServer.Application")
'Open a modal or non modal window until window is closed and new record
stored
MyApp.Show()
nresult=MyApp.GetResultKey()
mylistbox.list=Myapp.RecordArray(nresult)
End Function
This application presents a window and allows me to store records in an
SQLServer database.
When the data has been stored and the window has been closed, I can retrieve
the record
content from SQL passing it as a listbox array back to Outlook. My custom
form will then be
able to display the contents.
Everything works perfectly if I make MyApp.Show() a modal window but the one
problem is that
the window is iconized.
I can get around this problem by making the window non modal and forcing the
window to show by
effectively showing it twice.
Unfortunately, now that it's non modal Outlook doesn't wait for my
application to complete
and attempts to show the results before they have been stored.
Ideally I'd like to find a way to force a modal window over the top of the
Outlook form,
it can be done once the window has been opened for the first time.
Otherwise I could get around this new problem with a non modal window if
there was a way to force
an event such that I could notify completion of the database activity with
the event handler then
firing off the code to display the results in my listbox.
Could anyone suggest a way forward? A complete rewrite is not out of the
question:-(
TIA
Jeff Mowatt