View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Launchnet via OfficeKB.com Launchnet via OfficeKB.com is offline
external usenet poster
 
Posts: 47
Default How to open a new instance of Word and its .doc file

Hi Bernie . . .
Have both codes working. I had to change . . . Dim oWordDoc As Word.Document
to Dim oWordDoc As Object on second code (Sub NewWordWithDocument2()
Thanks very very much.

Bernie . . . If you are 30 or over, please read my story in
www.openoursite.com
Select: "Keywords" Then, Select: "Matt's Story" It can save your
life. My near perfect 1961 Red Chrysler 300 is on the front page of the site.


Again, many thanks. I'm doing my best for a 74 year old to learn, and it's
coming.

Matt @ Launchnet


Bernie Deitrick wrote:
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

Here I am back with another question.

[quoted text clipped - 23 lines]
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.

Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...tions/200706/1