Manage Learn to apply best practices and optimize your operations.

Send a fax

Want to send a fax from a customer database but don't have a Notes fax server set-up? You can use client software.

If you need to send a fax from a customer database but you don't have a fax server set-up on Notes, you can use client software like Winfax or other. All you need to know are the OLE classes related to the object you are using for faxing.
In your database, create an action button with the following formula:
@Command([FileSave]);
@Command([ToolsRunMacro];"(RunWinfax)");
@Command([FileCloseWindow])

RunWinfax agent:

'Declarations
Dim session As NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim objwinfax As Variant
Dim faxnum As Variant
Dim detail As Variant
Dim user As String
Dim temp As Variant
Dim plainText As String
Dim fileNum As Integer
Dim FileExists As Variant
Dim FolderExists As Variant
Dim WinFaxExists As Variant

Sub Initialize
'Checking if Winfax is installed
	WinfaxExists=(Dir("C:Program FilesSymantecWinFaxWFXCTL32.EXE")<>"")
	If Not WinfaxExists Then
		Messagebox "Please install WinFax to be able to fax your document. The document you created will be saved .", MB_OK, "Missing WinFax"
		Exit Sub
	End If
'Check or create a temporary folder on PC
	FolderExists=Dir("C:temp",16)
	If FolderExists="" Then
		Mkdir "C:temp"
	End If
'Check or create a temporary text file	
	FileExists = (Dir("C:tempnotefax.txt") <> "")
	If FileExits Then
		Kill "C:tempnotefax.txt"
	End If
	Set session= New NotesSession
	Set db = session.currentdatabase
	Set view = db.GetView("($FaxToSend)")
	user=session.Username
	
	Set doc = view.GetFirstDocument
	If doc Is Nothing Then Exit Sub
	While Not (doc Is Nothing)
'Checking if document was send already or 
'if the person clicking on the "Send fax" button is the author of the selected document 
		If doc.Faxsend(0)="No" And doc.Authors(0)=user Then
'Paste body field in a temporary text file
			temp=doc.GetItemValue("Body")
			plaintext=temp(0)
			fileNum=Freefile
			Open "c:tempnotefax.txt" For Append As fileNum
			Print #fileNum,plaintext
			Close #filenum
'The form contains an alternative fax number base on field AlterYes_No 
			If doc.AlterYes_No(0)="No" Then
				faxnum=doc.faxnum1
			Else
				faxnum=doc.faxnum2
			End If
			detail=doc.CoverPageText
'Create a WinFax object with setting
			Set objwinfax=CreateObject("WinFax.SDKSend8.0")
			objwinfax.SetCoverText(detail(0))
			objwinfax.SetNumber(faxnum(0))
			objwinfax.SetTo(doc.ContactName(0))
			objwinfax.SetSubject(doc.Subject(0))
			objwinfax.AddRecipient
'Attach the temporary text file. It could be in another format 
			objwinfax.addAttachmentFile("c:tempnotefax.txt")
'Win fax sender starting up, wait for 15 seconds
'Now Winfax take control of the transmission; If the phone line is busy or other error, you need to see Winfax Log 
			objwinfax.Send(0)
			Sleep 15
'Flag the document in notes 
			doc.faxsend="Yes"
			
			Call doc.Save( True,True)
			Kill "C:tempnotefax.txt"
		End If
		Set doc=view.GetNextDocument(doc)
		'If doc Is Nothing Then Exit Sub
	Wend	
End Sub

Dig Deeper on Domino Resources - Part 7

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchDataCenter

SearchContentManagement

Close