Hi All,
I'd like to get the content of windows(?), maybe they are MsgBoxes, that pop
up in MS Word, like the ReadabilityStatistics after the Grammar check.
Can I get control to the window that has the results of the grammar check?
So far I am activating it:
---
Private Sub TestMSWordFunc(ByVal file As String)
'MS Word declarations
Dim wordApp_Server As Word.Application
Dim wordDoc As Word.Document
Dim wordRange As Word.Range
Dim wordStatistic As Word.ReadabilityStatistic
Dim wordStatistics As Word.ReadabilityStatistics
Dim wordWnd As Word.Window
Dim wordGrammarDlg As Word.Dialog
'Other
Dim testObject As Object
Dim fileMod As Boolean
Dim activeFile As String
Dim i As Integer
Dim strPropsInfo As String
'Open an application server first
wordApp_Server = New Word.Application
wordApp_Server.Documents.Add()
wordDoc = wordApp_Server.Documents.Open( _
FileName:=file, _
ConfirmConversions:=False, _
ReadOnly:=True, _
AddToRecentFiles:=True, _
Format:=Word.WdOpenFormat.wdOpenFormatAuto, _
Visible:=False)
'Close document that is created when Document is Add()ed
wordApp_Server.ActiveDocument().Close(SaveChanges: =False)
'Activate document selected by the user
wordDoc.Activate()
'Document must be set active in order to retrieve further information
Try
activeFile = wordApp_Server.ActiveDocument.Name()
Catch
MsgBox("There is no active file within the application.",
MsgBoxStyle.Information)
GoTo Cleanup
End Try
'This is the (last) window of the application
wordWnd = wordApp_Server.Windows.Item(wordApp_Server.Windows .Count)
wordWnd.Activate()
wordGrammarDlg =
wordApp_Server.Dialogs.Item(Word.WdWordDialog.wdDi alogToolsSpellingAndGrammar)
wordGrammarDlg.Execute()
<-Here I would like to get a refernce to the window with the
statistics! ->
---
Any ideas and help appreciated.
Kisses and regards
Melanie