Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Printing to word from excel
I am new to coding and I have a question on how to print a word doc
from excel and place some text on the word doc from the excel file. I have gotten as far as printing the word doc from excel. I used this code I found in this group. I have a spot for typing the cusotmer name and address in the excel file and I would like to have that information placed in a bookmarked form field in the word doc so it prints out. Also I would like for the user to see a box that allows them to choose the printer instead of the print out just going to the default printer. See below code: Sub cmdPrintCoverLetter() Dim bStarted As Boolean Dim oApp As Word.Application On Error Resume Next Set oApp = GetObject(, "Word.Application") 'Get the running instance of Word, if there is no instance 'create a new one: If Err < 0 Then bStarted = True Set oApp = CreateObject("Word.Application") End If oApp.Activate oApp.Visible = True 'Open document oApp.Documents.Open Filename:="c:\remodel\CoverLetter.doc" 'Print file oApp.ActiveDocument.PrintOut oApp.ActiveDocument.Close savechanges:=wddonotsavechanges 'Quit only when Word was not running when we started this code If bStarted Then oApp.Quit End If Set oApp = Nothing End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Embedding Word Docs into Excel Worksheets and Then Printing The Word Docs | Excel Worksheet Functions | |||
Printing MS Word Doc From MS Excel | Excel Discussion (Misc queries) | |||
Excel VBA printing to MS Word cause MS Word to crash, why? | Excel Programming | |||
Printing Word Document using Excel Programming hangs Word | Excel Programming | |||
Printing a Word doc from Excel | Excel Programming |