Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Opening a Word Document in Excel

Hi -
1. How do I open a specific word document from Excel?
The document is actually mail merged to the excel
spreadsheet (which isn't a problem).

Ex. I have excel doing a loop of about 200 calculations
which stores the information for the word doc. and it
prints off the results. Next, I want the word document to
open and run through a macro. I have the document to
close each time because I need the original document to
open for each calculation. This is handled through word -
no problem (I already have this programmed). However,
this leads me to my 2nd and final question.

2. How do I keep Excel from prompting me to save? I do
not want to have to hit cancel (about 200 times) everytime
the document closes.

*****If you can't answer 2 right away, that's okay, but
please help me with #1. I'm in great need of an answer.

XP is the OS.

Thanks so much!!!!!

Tonja
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Opening a Word Document in Excel

Tonja,

For #1 see the example code below. Be sure to build a
reference to the MS Word Object library via tools.

Sub test()
Dim objWordApp As Word.Application
Dim strFileName As String

Set objWordApp = New Word.Application
objWordApp.Visible = True
strFileName = "c:\temp\test.doc"
objWordApp.Documents.Open strFileName
End Sub

For #2 simply set the property of the worksheet as shown
below.

ActiveWorkbook.Saved = True

If the workbook to be closed is not the active workbook,
then simply set the reference appropriately.

-Tim


-----Original Message-----
Hi -
1. How do I open a specific word document from Excel?
The document is actually mail merged to the excel
spreadsheet (which isn't a problem).

Ex. I have excel doing a loop of about 200 calculations
which stores the information for the word doc. and it
prints off the results. Next, I want the word document

to
open and run through a macro. I have the document to
close each time because I need the original document to
open for each calculation. This is handled through word -


no problem (I already have this programmed). However,
this leads me to my 2nd and final question.

2. How do I keep Excel from prompting me to save? I do
not want to have to hit cancel (about 200 times)

everytime
the document closes.

*****If you can't answer 2 right away, that's okay, but
please help me with #1. I'm in great need of an answer.

XP is the OS.

Thanks so much!!!!!

Tonja
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Opening a Word Document in Excel

Thank you very much, Tim.



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Opening a Word Document using an Excel (2000) Macro? ekreider Excel Discussion (Misc queries) 4 January 5th 08 04:41 AM
opening word document rk0909 Excel Discussion (Misc queries) 0 January 10th 07 02:42 PM
Trouble opening Word document Richard Excel Discussion (Misc queries) 1 August 2nd 06 02:37 PM
Opening word document through excel vba srinums Excel Discussion (Misc queries) 0 June 8th 06 12:02 PM
Opening Word Document with excel [email protected] Excel Discussion (Misc queries) 0 March 21st 05 01:49 AM


All times are GMT +1. The time now is 05:24 PM.

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

About Us

"It's about Microsoft Excel"