I am using the code from http://www.vb-helper.com/howto_net_spellcheck.html that uses Microsoft Word's spell checker and modified slightly to fit my application. But sometimes the spell check window opens on the secondary monitor and need it to open on the same monitor as the VB.net application. During user testing, user's are unable to locate the spell check window because it's on their other monitor.
I know a little VB.net but obviously not enough to solve this problem. I have Googled and mostly open VB form on a particular monitor but that isn't what I'm after. My code:
If RTBProposedProcedure.Text.Length > 0 Then
'Make a Word server object.
Dim word_server As New Word.Application With {.Visible = False} 'Hide the server.
Dim doc As Word.Document = word_server.Documents.Add() ' Make a Word Document.
Dim rng As Word.Range
rng = doc.Range() 'Make a Range to represent the Document.
rng.Text = RTBProposedProcedure.Text ' Copy the text into the Document.
doc.Activate() ' Activate the Document and call its CheckSpelling method.
doc.CheckSpelling()
Dim chars() As Char = {CType(vbCr, Char), CType(vbLf, Char)} 'Copy the results back into the TextBox, trimming off trailing CR and LF chars.
RTBProposedProcedure.Text = doc.Range().Text.Trim(chars)
doc.Close(SaveChanges:=False) ' Close the Document, not saving changes.
word_server.Quit() ' Close the Word server.
MsgBox("Spelling Check Finished", MsgBoxStyle.Information)
End If
Which works fine (thank you VB Helper) but I can't figure out how to get the spell check window to open on the same monitor as the application?
Please help.
Thank you in advance