469,903 Members | 2,182 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,903 developers. It's quick & easy.

Grab window content.

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
Jul 21 '05 #1
0 1155

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by dan glenn | last post: by
reply views Thread by Baby Blue | last post: by
12 posts views Thread by HarveyB | last post: by
reply views Thread by Mel_la_Bel | last post: by
1 post views Thread by Robert T. | last post: by
reply views Thread by Grey | last post: by
1 post views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.