Printing a letter from access

ddennis

New Member
Joined
Apr 21, 2004
Messages
22
Good day:

I am new to Access 2000. I have created a form where using a command button( A print letter button) will print a letter stored in Word.

Any ideas on how to accomplish this?

Many thanks in advance.

Dion
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
This code should do it, you will need to set a reference to theWord libary for it to work. open any module and Tools>references... Scroll dow and find "Microsoft Word 9.0 Object Libary" (number may vary) and select it.
Code:
Sub WordTest()
Dim appWord As Word.Application
Dim wdDoc As Word.Document

Set appWord = New Word.Application
' The path/name of the Word document goes here
Set wdDoc = appWord.Documents.Open("C:\Temp\Temp.doc")
wdDoc.PrintOut (False)
wdDoc.Close (False)
appWord.Quit
Set wdDoc = Nothing
Set appWord = Nothing
End Sub


HTH

Peter
 
Upvote 0

Forum statistics

Threads
1,221,808
Messages
6,162,097
Members
451,741
Latest member
shove

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top