Advertisement
7_2009-2012 OLE/ COM/ DCOM/ Active-X #218734

Fax

I was looking for code to fax on PSC. found some fax stuff but people had some problems. Hopefully this solves it. It worked for me. Put this code in a Class Module.

AI

สรุปโดย AI: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

ซอร์สโค้ด
original-source
Private Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Public Function Fax(ByVal FileName As String, ByVal FaxNumber As String)
Dim FaxServer As Object
Dim FaxDoc As Object
Dim ComputerName As String
  ComputerName = String(50, Chr(0))
  Call GetComputerName(ComputerName, 50)
  ComputerName = Trim(Replace(ComputerName, Chr(0), ""))
  
  Set FaxServer = CreateObject("FaxServer.FaxServer")
  FaxServer.Connect ("\\" & ComputerName)
  
  Set FaxDoc = FaxServer.CreateDocument(FileName)
  With FaxDoc
    .FaxNumber = FaxNumber
    .Send
  End With
   
  
  Set FaxDoc = Nothing
  Set FaxServer = Nothing
End Function
ความคิดเห็นดั้งเดิม (3)
กู้คืนจาก Wayback Machine