View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bernie Deitrick Bernie Deitrick is offline
external usenet poster
 
Posts: 5,441
Default How to open a new instance of Word and its .doc file

Sub NewWordOnly2()
Dim oWordApp As Object
Set oWordApp = CreateObject("Word.Application")
oWordApp.Visible = True
oWordApp.Documents.Add DocumentType:=wdNewBlankDocument
End Sub

Sub NewWordWithDocument2()
Dim oWordApp As Object
Dim oWordDoc As Word.Document

Set oWordApp = CreateObject("Word.Application")
oWordApp.Visible = True
Set oWordDoc = oWordApp.Documents.Open( _
"C:\documents and settings\default\my documents\travelagent.doc")
End Sub


HTH,
Bernie
MS Excel MVP


"Launchnet" <u20911@uwe wrote in message news:73db311eb6a95@uwe...
Here I am back with another question.

I need an Excel Macro that will open "MS Word" with a blank document shown.

Secondly, I need an Excel Macro that will open "MS Word with a "Named.doc"

Please see the two codes I have tried. Both will open Word, but neither will
display a blank document or a "Named.doc"

I copied the following ideas from 2 Macro's received so thankfully from Bob.

Sub NewWordOnly()
Dim oXL As Object
Set oXL = CreateObject("Word.Application")
oXL.Visible = True
oXL.BlankDocument.Add
End Sub

Sub NewWordWithDocument()
Dim oMS As Object
Dim oWD As Object

Set oMS = CreateObject("Word.Application")
oMS.Visible = True
Set oWD = oXL.BlankDocument.Open("C:\documents and settings\default\my
documents\travelagent.doc")
End Sub

--
Please take a look at www.openoursite.com Click on: "Keywords" and then
Click on "Matt's Story" and if you are a man, you should be very happy that
you read my story. God Bless for everyones help.