gwidijanto
Registered User.
- Local time
- Today, 05:52
- Joined
- May 4, 2003
- Messages
- 28
Hi guys,
I have a form with a button for sending fax using Winfax 10.0 automatically.
After searched several days for VBA script and no success to run it, finally I can run
two of it combine, not perfect but seems no error detected.
First I use this script taken from:
http://www.experts-exchange.com/Databases/MS_Access/Q_20568874.html
nothing happen, the default printer couldn't change to Winfax.
So I combine with this script taken from:
http://www.experts-exchange.com/Databases/MS_Access/Q_20651012.html
I use the first script for function module and the second script for action.
now, it's work and the action script become like this:
Private Sub FAX_Click()
Dim WshNetwork As Object 'taken from second script'
Dim strCurrentPtr As String
Set WshNetwork = CreateObject("WScript.Network") 'taken from second script'
Debug.Print GetDefaultPrinter 'taken from first script'
strCurrentPtr = GetDefaultPrinter 'taken from first script'
Debug.Print SetDefaultPrinter("WINFAX") 'taken from first script'
DoCmd.PrintOut , 1, 2
SetDefaultPrinter strCurrentPtr 'taken from first script'
WshNetwork.SetDefaultPrinter strCurrentPtr 'taken from second script'
Set WshNetwork = Nothing
End Sub
Since I newbies with VB script, I would like to know if there is any better script for
this action.
And this the important thing:
I can't get "Winfax send Window" to appear on the screen so I can edit it, how to do
this with VB script and inserted it to the script above?
Thank you so much for any help.
Gunawan.
I have a form with a button for sending fax using Winfax 10.0 automatically.
After searched several days for VBA script and no success to run it, finally I can run
two of it combine, not perfect but seems no error detected.
First I use this script taken from:
http://www.experts-exchange.com/Databases/MS_Access/Q_20568874.html
nothing happen, the default printer couldn't change to Winfax.
So I combine with this script taken from:
http://www.experts-exchange.com/Databases/MS_Access/Q_20651012.html
I use the first script for function module and the second script for action.
now, it's work and the action script become like this:
Private Sub FAX_Click()
Dim WshNetwork As Object 'taken from second script'
Dim strCurrentPtr As String
Set WshNetwork = CreateObject("WScript.Network") 'taken from second script'
Debug.Print GetDefaultPrinter 'taken from first script'
strCurrentPtr = GetDefaultPrinter 'taken from first script'
Debug.Print SetDefaultPrinter("WINFAX") 'taken from first script'
DoCmd.PrintOut , 1, 2
SetDefaultPrinter strCurrentPtr 'taken from first script'
WshNetwork.SetDefaultPrinter strCurrentPtr 'taken from second script'
Set WshNetwork = Nothing
End Sub
Since I newbies with VB script, I would like to know if there is any better script for
this action.
And this the important thing:
I can't get "Winfax send Window" to appear on the screen so I can edit it, how to do
this with VB script and inserted it to the script above?
Thank you so much for any help.
Gunawan.