Hello
I'm working on a Microsoft Word VSTO (Visual Studio Tools for Office)
project (2003). The 'host' Word document has a custom command button
which brings up a Windows Form via the following (C#) code
private void RunScript_Click( Office.CommandBarButton Ctrl, ref
Boolean CancelDefault )
{
__pyScriptForm = new PyScriptForm( this.ThisApplication );
__pyScriptForm.Show();
}
where 'ThisApplication' is of type
/Microsoft.Office.Interop.Word.Application/.
This form is used to run scripts written in Python, capture their
'StdOut', and write it to the underlying document. This works as I
want - as the script runs, the output appears on the document below.
However, I think it would be preferable if the form were shown modally
- the document shouldn't be accessible while a script is running, and
there's a Cancel button on the form that will stop the script. But if
I do this ( with ShowDialog rather than Show ), then the written output
doesn't show up until the Form is closed. It's more satisfactory if
you get the data appearing right away.
Can I have my cake and eat it with this - ie. have a modal form, but
also see the script output?
TIA
G.F.