Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Open Words doc from Excel Macro

Hi,

New to the usergroup. Question: I'm trying to create an excel macro that
will pickup filename from a spreadsheet and open the file in Words
document, then do more formatting changes to the document. I seems to be
stuck at trying to open a Words document from an excel macro. Any
thoughts? Thanks in advance.

Isham


*** Sent via Developersdex http://www.developersdex.com ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 486
Default Open Words doc from Excel Macro

Try this... You need to reference your project to the "Microsoft Word ?.?
Object Library". In the VB Editor select Tools - References ...

Sub OpenWordDoc()
Dim appWord As Word.Application

Set appWord = New Word.Application
With appWord
.Visible = True
.Documents.Open "D:\Test.doc"
End With
Set appWord = Nothing
End Sub

--
HTH...

Jim Thomlinson


"Isham Hamin" wrote:

Hi,

New to the usergroup. Question: I'm trying to create an excel macro that
will pickup filename from a spreadsheet and open the file in Words
document, then do more formatting changes to the document. I seems to be
stuck at trying to open a Words document from an excel macro. Any
thoughts? Thanks in advance.

Isham


*** Sent via Developersdex http://www.developersdex.com ***

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Open Words doc from Excel Macro

In A1 put, for example:
C:\third.doc
actually the path and filename of any Word doc. Then enter and run this
small macro:


Sub macro2()

Dim s As String
Dim ss As String
Dim sss As String

ss = "cmd.exe /c "
s = Cells(1, 1).Value
sss = ss & s
x = Shell(sss, 1)
End Sub

You will be in control in Word.
--
Gary's Student


"Isham Hamin" wrote:

Hi,

New to the usergroup. Question: I'm trying to create an excel macro that
will pickup filename from a spreadsheet and open the file in Words
document, then do more formatting changes to the document. I seems to be
stuck at trying to open a Words document from an excel macro. Any
thoughts? Thanks in advance.

Isham


*** Sent via Developersdex http://www.developersdex.com ***

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
Open Excel file from VB and open MACRO no1jimmyman Excel Discussion (Misc queries) 0 February 14th 11 10:10 PM
open up an excel program with an auto open macro [email protected] Excel Programming 2 July 17th 05 04:48 PM
Macro - Open Word with Excel macro Bill Excel Discussion (Misc queries) 3 May 23rd 05 11:21 PM
ASP: Open Excel File with Macro, Allow Macro to run, and then save delgados129 Excel Programming 0 March 10th 05 09:35 PM
Macro to transfer info from Excel to Words envelope Dialog box. EWASHI5279 Excel Programming 1 August 29th 03 10:47 PM


All times are GMT +1. The time now is 08:13 AM.

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

About Us

"It's about Microsoft Excel"