after using spell check from vb6 not close properly normal.dot

A

Ansar_Mehmood

I am ussing spell check of word 2002 in our VB project. Its works fine when
running first time but 2nd time display a error message that error in your
'normal.dot' file, please give me solution on '(e-mail address removed)' or
'(e-mail address removed)'

my codes are

Private Sub Command1_Click()
Dim oWord As Object
Dim oTmpDoc As Object
Dim lOrigTop As Long

' Create a Word document object...
Set oWord = CreateObject("Word.Application")
Set oTmpDoc = oWord.Documents.Add
oWord.Visible = True
' Position Word off screen to avoid having document visible...
lOrigTop = oWord.Top
oWord.WindowState = 0
oWord.Top = -3000
' copy the contents of the text box to the clipboard
Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)
Clipboard.Clear
Clipboard.SetText Text1.SelText

' Assign the text to the document and check spelling...

With oTmpDoc
.Content.Paste
.Activate
.CheckSpelling

' After user has made changes, use the clipboard to
' transfer the contents back to the text box
.Content.Copy
Text1.Text = Clipboard.GetText(vbCFText)
' Close the document and exit Word...
.Saved = True
.Close

End With
Set oTmpDoc = Nothing

oWord.Top = lOrigTop
oWord.quit
Set oWord = Nothing

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top