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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
corvanderlindenCommented:

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mhdhallakAuthor Commented:
You forgot:

wrd.Visible = True

It's ok, I figured it out myself.

Thanks anyway
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.