- This topic is empty.
-
AuthorPosts
-
December 29, 2005 at 8:50 pm #2659AnonymousMember
I am now right at the last fence in what has been an “interesting” assignment!
I have found the following excellent code on your forum, the problem is that the documemnt appears in a “preview” kind of pane, I just want it to go ahead and send! Everything else works fine
Public Function SendFax()
‘On Error GoTo ErrorHandler
Dim strRecipient As String
Dim strFax As String
Dim strattach As String‘Test for required fields
strFax = Forms!frmFinanceProposal!Text1077
If strFax = “” Then
MsgBox “Please enter a fax number”
GoTo ErrorHandlerExit
End IfDebug.Print “Fax: ” & strFax
strattach = “C:InboundFaxesFax.snp”
Debug.Print “Attachment: ” & strattach‘Start DDE connection to WinFax.
‘Create the link and disable automatic reception in WinFax
lngChannel = DDEInitiate(Application:=”FAXMNG32″, topic:=”CONTROL”)
DDEExecute ChanNum:=lngChannel, Command:=”GoIdle”
DDETerminate ChanNum:=lngChannel‘Create a new link with the TRANSMIT topic.
lngChannel = DDEInitiate(“FAXMNG32”, “TRANSMIT”)‘Start DDEPokes to control WinFax.
strRecipient = “recipient(” & Chr$(34) & strFax & Chr$(34) & “)”
Debug.Print “Recipient string: ” & strRecipient
Debug.Print “Length of recipient string: ” & Len(strRecipient)
DDEPoke ChanNum:=lngChannel, Item:=”sendfax”, Data:=strRecipient‘Specify attach
DDEPoke ChanNum:=lngChannel, Item:=”sendfax”, _
Data:=”attach(” & Chr$(34) _
& strattach & Chr$(34) & “)”‘Show send screen
DDEPoke ChanNum:=lngChannel, Item:=”sendfax”, _
Data:=”showsendscreen(” & Chr$(34) _
& “0” & Chr$(34) & “)”‘Set resolution
DDEPoke ChanNum:=lngChannel, Item:=”sendfax”, _
Data:=”resolution(” & Chr$(34) _
& “LOW” & Chr$(34) & “)”‘Dim prtLoop As Printer
‘For Each prtLoop In Application.Printers
‘ With prtLoop
‘MsgBox “Device name: ” & .DeviceName & vbCr _
‘ & “Driver name: ” & .DriverName & vbCr _
‘ & “Port: ” & .Port
‘End With
‘Next prtLoop‘ code to switch the printer driver to winfax “WinFax on FaxModem” goes here
‘Dim prtDefault As Printer‘Set Application.Printer = Application.Printers(0)
‘Set prtDefault = Application.Printer
‘Send the fax
DDEPoke ChanNum:=lngChannel, Item:=”sendfax”, Data:=”SendfaxUI”
DDETerminate ChanNum:=lngChannel
lngChannel = DDEInitiate(Application:=”FAXMNG32″, topic:=”CONTROL”)
DDEExecute ChanNum:=lngChannel, Command:=”GoActive”
DDETerminate ChanNum:=lngChannellngChannel = DDEInitiate(Application:=”FAXMNG32″, topic:=”CONTROL”)
DDEExecute ChanNum:=lngChannel, Command:=”GoActive”
DDETerminate ChanNum:=lngChannel‘*************NEED A COMMAND HERE TO GO AHEAD AND PERFORM THE SEND!
ErrorHandlerExit:
‘DoCmd.Close objecttype:=acForm, objectname:=Me.Name
Exit FunctionErrorHandler:
MsgBox “Error No: ” & Err.Number & “; Description: ” & _
Err.Description
Resume ErrorHandlerExitEnd Function
January 11, 2006 at 2:25 am #4511AnonymousMemberIf you have this problem then you need to do this
In the Registry Editor (RegEdit), locate and select the following key. HKEY_CURRENT_USERSoftwareDelrinaWinFax7.0GeneralDouble-click the PreviewFax entry.
Change the value to N and click OK.
Exit and restart WinFax.This entry is not used in WinFax PRO 9,10 and seems to be a left over from 8.0 days. Likely you find that this problem is on a machine that was upgraded with an older version of WinFax.
January 29, 2006 at 9:51 pm #4512AnonymousMembertnx for the reply, my registry does not contain this key at all! Any further suggestions?
February 1, 2006 at 9:23 pm #4513 -
AuthorPosts
- You must be logged in to reply to this topic.