Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vb& word

Status
Not open for further replies.

horoscope

Technical User
Dec 1, 2002
17
CN
Private Sub Command1_Click()
Set MyApp = CreateObject("Word.Application")
Set doc = MyApp.Documents.Open("c:\1.doc")
If doc Is Nothing Then
MsgBox MyFileName & "can not open this file!"
End If


doc.Close / there is wrong, can not find close this property. can you tell me why. how to change it,
Set doc = Nothing
MyApp.Quit
Set MyApp = Nothing
Call ParseWordfile.ParseWord

End Sub
 
Either of the following will work.

ALWAYS DIM the variables, and ALWAYS use "option explicit"

Sub aa()

Dim a As Word.Application
Dim b As Word.Document
a.ActiveDocument.Close
b.Close
End Sub


Regards

Frederico Fonseca
SysSoft Integrated Ltd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top