Here's the code...
use Win32::OLE;
use WIN32::OLE::Const 'Microsoft Word';
my $word;
eval {$word = Win32::OLE->GetActiveObject('Word.Application')};
die "Word not installed" if $@;
unless (defined $word) {
$word = Win32::OLE->new('Word.Application','Quit')
or die "oops, cannot start Word";
$word->{DisplayAlerts} = wdAlertsNone;
my $doc = $word->Documents->Open("D:\\path\file.doc, {Visible => 1})
or die "Cannot open document " . Win32::OLE->LastError;
# AutoOpen macro configured/defined within Word to run
# the ConvertEquations macro - which produces the pop-up
# program ONLY progresses once the OK button on the
# pop-up has been MANUALLY pressed
$doc->SaveAs("D:\\outpath\\file.rtf, {FileFormat => wdFormatRTF});
$doc->Close;
########
# AutoOpen Macro ...
Sub AutoOpen ()
'
' AutoOpen Macro
' the next bit of code is in ONE line
' - just in case it doesn't appear that way!
Application.Run MacroName:="MTCommandsMain.MTConvertEquations.Main"
End Sub
#########
In fact, having just run the ConvertEquations command again I notice that there are TWO OK buttons to press: the first to OK the pop-up (where options can be set/changed) and once the equations have been converted, there's a second pop-up to tell me that it's finished.
Good luck!
regards
Mark H., AFX