Simple Question....

Ok, this is an easy question.

Can somebody give me the code that will open a Microsoft Word (either 97 or 2000) file?
mhdhallakAsked:
Who is Participating?
 
corvanderlindenConnect With a Mentor Commented:

Set wrd = CreateObject("Word.Application")

wrd.Documents.Open FileName:="C:\My Documents\Sales.doc"

Create a new doc


wrd.Documents.Add

' When you finish, use the Quit method to close  the application, then release

wrd.quit
set wrd = nothing

For excel

Dim xlApp As Object    ' Declare variable to hold the reference.
   
Set xlApp = CreateObject("excel.application")
xlApp.Visible = True

xlApp.Workbooks.Open filename:="LARGE.XLS"

' When you finish, use the Quit method to close  the application, then release

xlApp.Quit
Set xlApp = Nothing    

0
 
mhdhallakAuthor Commented:
Edited text of question.
0
 
mhdhallakAuthor Commented:
Yeah, and I also need a fragment that will open an Excel file of CSV format.
0
 
sudhi022299Commented:
Sub Command1_Click ()
   Set oWDBasic = CreateObject("Word.Basic")
         oWDBasic.FileNew "C:\test.doc"

End Sub

Regards,
Sudhi.
0
 
mhdhallakAuthor Commented:
You forgot:

wrd.Visible = True

It's ok, I figured it out myself.

Thanks anyway
0
All Courses

From novice to tech pro — start learning today.