Impletementing this ms fax code

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I found the following code

Sub SwitchPrinter()
Dim strActivePrinter As String
' Get active printer.
strActivePrinter = Application.ActivePrinter
' Change to the Microsoft Fax printer driver.
Application.ActivePrinter = "Microsoft Fax"
' Print the active document to Fax.
ActiveDocument.PrintOut
' Change back to the default printer.
Application.ActivePrinter = strActivePrinter
End Sub

At this link

http://support.microsoft.com/default.aspx?scid=kb;en-us;202017

But i do not know how to implement it into my database. Can someone let me
know how to put this into a event procedure(onMouseClick) for a button.
 
Hi,

this code snippet is from word vba and the referenced application is word.
When you want to implement this to access you first have to reference the
word library under references in the vba editor. Second you will have to
initialize a word application object and now you can access the named methods
on this application object, e.g.

Dim objWord as Word.Application
....
Set objWord = New Word.Application
....
strActivePrinter = objWord.ActivePrinter
.... and so on ...

But a MVP answered this a little more detailed for Access a few days before,
perhaps you should search for printer in November in this discussion board.
 
Back
Top