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保持打開狀態,我可以看到一個臨時文件已經創建,它不能從最近的文件列表菜單中打開。