A Microsoft Excel forum. ExcelBanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » ExcelBanter forum » Excel Newsgroups » Excel Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

How to open a new instance of Word and its .doc file



 
 
Thread Tools Display Modes
  #1  
Old June 18th 07, 01:04 AM posted to microsoft.public.excel.worksheet.functions
Launchnet
external usenet poster
 
Posts: 25
Default How to open a new instance of Word and its .doc file

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.
Ads
  #2  
Old June 18th 07, 03:01 PM posted to microsoft.public.excel.worksheet.functions
Bernie Deitrick
external usenet poster
 
Posts: 5,444
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.



  #3  
Old June 18th 07, 06:11 PM posted to microsoft.public.excel.worksheet.functions
Launchnet via OfficeKB.com
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

  #4  
Old June 18th 07, 06:20 PM posted to microsoft.public.excel.worksheet.functions
Bernie Deitrick
external usenet poster
 
Posts: 5,444
Default How to open a new instance of Word and its .doc file

Matt,

If you set a reference to MS Word, then the dimming of oWordDoc would work... I forgot to state
that, just assuming that you would have it already...

HTH,
Bernie
MS Excel MVP


"Launchnet via OfficeKB.com" <u20911@uwe> wrote in message news:73e45e34619b8@uwe...
> 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
>



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Open new instance of excel every time I click file VIPGeorge Excel Discussion (Misc queries) 5 August 16th 12 07:57 PM
How to open a new instance of EXCEL and .xls file Launchnet Excel Worksheet Functions 10 June 19th 07 03:45 PM
Open new instance of excel 2007 every time I click file Brian Excel Discussion (Misc queries) 0 April 10th 07 08:16 PM
I would like to open a new instance of Excel each time I double-click on a xls file Mark Excel Discussion (Misc queries) 4 September 1st 05 02:29 PM
I would like to open a new instance of Excel each time I double-click on a xls file Mark Excel Worksheet Functions 4 September 1st 05 02:29 PM


All times are GMT +1. The time now is 01:31 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright 2004-2014 ExcelBanter.
The comments are property of their posters.