Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Steve,
Maybe the ShellExecute API with the Operation set to "print". Then you do not need to know which application to open; the default for that file type is used. Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long Dim RetVal As Long RetVal = ShellExecute(&O0, "print", "C:\Doc.doc", vbNullString, vbNullString, &O0) If RetVal <= 32 Then MsgBox "Error: Cannot print" End If NickHK "Steve" wrote in message ... I am using a VBA control - Command button. and I would like to be able to print a word document by pressing it. The file is a fax cover sheet, which is an important part of the application I am making. Is there anyway this can be achieved. Thank you to all who are able to help |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel 2003 printing problem--printing 1 document on 2 pages | Excel Discussion (Misc queries) | |||
About printing a document | Excel Discussion (Misc queries) | |||
Automating a printing of pages that are Hyperlinked to external so | Excel Worksheet Functions | |||
Not printing whole document | Excel Discussion (Misc queries) | |||
Printing and Document Name | Excel Programming |