LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Printing from Excel using a macro - Phase II

The following is a solution I recently implemented. Now the list of
links described below has evolved into something that may also contain
links to excel files and pdf files. My macro uses MS Word as the App.
Is there a way that I can have the macro choose the appropriate app as
it reads the list of links? As of right now, predictably, only the
Word foles are printing correctly.



Printing from EXCEL using a macro
All 6 messages in topic - view as tree
From: jim9912 - view profile
Date: Wed, Apr 12 2006 4:38 pm
Email: "jim9912"
Groups: microsoft.public.excel.programming
Not yet ratedRating:
show options


Reply | Reply to Author | Forward | Print | Individual Message | Show
original | Remove | Report Abuse | Find messages by this author


I am trying to develop a macro to read a list of links from an excel
spreadsheet and print each of the files associated with the links. The

number of files in the
list may change.

ANy ideas?


Reply





From: Zack Barresse - view profile
Date: Wed, Apr 12 2006 4:53 pm
Email: "Zack Barresse"
Groups: microsoft.public.excel.programming
Not yet ratedRating:
show options


Reply | Reply to Author | Forward | Print | Individual Message | Show
original | Report Abuse | Find messages by this author


Hi jim9912,

Can you give some examples of the list?


--
Regards,
Zack Barresse, aka firefytr
To email, remove NOSPAM



"jim9912" wrote in message


ps.com...


- Hide quoted text -
- Show quoted text -

I am trying to develop a macro to read a list of links from an excel
spreadsheet and print each of the files associated with the links. The
number of files in the
list may change.


ANy ideas?




Reply Rate this post: Text for clearing space





From: jim9912 - view profile
Date: Wed, Apr 12 2006 8:13 pm
Email: "jim9912"
Groups: microsoft.public.excel.programming
Not yet ratedRating:
show options


Reply | Reply to Author | Forward | Print | Individual Message | Show
original | Remove | Report Abuse | Find messages by this author


Sure, here's a sample, but te path, filename, and number of links will
vary.

C:\Project Books\Templates\Clearance Sheets\BrgThrust&JournalClr.doc
C:\Project Books\Templates\Clearance Sheets\BrgThrust&JournalClr2.doc
C:\Project Books\Templates\Clearance Sheets\BrgThrustPadInsp.doc
C:\Project Books\Templates\Clearance Sheets\RotorAxialPosition.doc
C:\Project Books\Templates\Clearance Sheets\RotorAxPosThrustClr.doc


Reply





From: Zack Barresse - view profile
Date: Thurs, Apr 13 2006 2:48 pm
Email: "Zack Barresse"
Groups: microsoft.public.excel.programming
Not yet ratedRating:
show options


Reply | Reply to Author | Forward | Print | Individual Message | Show
original | Report Abuse | Find messages by this author


Okay, making some assumptions here, this should do you right ...

Sub PrintDocuments()
'Must set a reference (Tools | References) to:
' Microsoft Word 11.0 Object Library
'11.0 = 2003, 10.0 = 2002 (XP), 9.0 = 2000, etc.
Dim WDApp As Word.Application, WDDoc As Word.Document
Dim c As Range, rngFiles As Range
Set rngFiles = Range("A2", Cells(Rows.Count, "A").End(xlUp))
Set WDApp = New Word.Application
WDApp.Visible = True
For Each c In rngFiles
Set WDDoc = WDApp.Documents.Open(c.Value)
WDDoc.PrintOut copies:=1
WDDoc.Close False
Set WDDoc = Nothing
Next c
WDApp.Quit False
Set WDApp = Nothing
End Sub


This assumes that the activesheet will house the data you posted,
otherwise
you'll need to explicitly set it. It also assumes the data starts in
A2 and
goes downward and is the only data in that column. You'll need to set
a
reference to the Word Object Library as shown in the comments in the
code.


If you have any questions let me know.


HTH

 
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
Chart in time phase jzis Charts and Charting in Excel 3 June 11th 09 04:17 PM
Phase reporting Jonathan B. Excel Discussion (Misc queries) 3 July 25th 06 05:13 PM
Phase change line on a graph? tobyhons Excel Discussion (Misc queries) 1 May 16th 06 08:25 PM
How can I insert a phase line in to a graph? tobyhons Excel Discussion (Misc queries) 1 May 16th 06 12:54 PM
phase line in an Excel graph tobyhons Excel Discussion (Misc queries) 0 December 15th 05 02:09 PM


All times are GMT +1. The time now is 11: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"