1
我正在运行Windows Server 2008 R2。我在服务器上安装了传真服务器角色。通过打印文档并选择“在MYSERVER上传真”,我可以使用连接到网络的计算机连接到服务器的外部传真调制解调器传真文档。我能够使用以下代码(我从mdsn.microsoft.com获得)从服务器传真.pdf,但即使使用管理员帐户登录到计算机,也不能从任何其他计算机传真。从网络上的计算机使用服务器上的传真服务器的VBA传真
Sub fax_report(location_fax_number, report_name, fax_location, fax_file_path)
Dim objFaxDocument As New FAXCOMEXLib.FaxDocument
Dim objFaxServer As New FAXCOMEXLib.FaxServer
Dim JobID As Object
On Error GoTo Err_Clear
Err_Clear:
If Err <> 0 Then
Err.Clear
Resume Next
End If
'Connect to the fax server
objFaxServer.Connect ("\\MYSERVER")
'Set the fax body
objFaxDocument.Body = fax_file_path
'Name the document
objFaxDocument.DocumentName = report_name
objFaxDocument.Recipients.add (location_fax_number)
JobID = objFaxDocument.ConnectedSubmit(objFaxServer)
objFaxServer.Disconnect
End Sub
我得到的错误是:
- 描述: “操作失败”
- HelpContext:1000440
- 帮助文件:“C:\ Program Files文件(x86)的\ Common Files文件\微软 共享\ VBA \ VBA7.1 \ 1033 \ VbLR6.chm”
- LastDllError:0
- 号:-2147023741
- 来源:“FaxComEx.FaxDocument.1”
虽然我能够从服务器传真为.pdf,当我从失败的网络上的计算机尝试。我可以从网络上的计算机发送一个.txt文件。它看起来像.pdf不会自动转换为.tiff文件,就像我在服务器上运行代码时一样。当我从服务器Adobe Acrobat Reader DC打开服务器运行代码时,打开.pdf并转换,然后传真,没有错误。 Adobe保持打开状态,我可以看到一个临时文件已经创建,它不能从最近的文件列表菜单中打开。