Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RightFax VBA Coding in Access 2002

Status
Not open for further replies.

Page410

Technical User
Mar 9, 2001
106
0
0
US
Has anyone done any VBA coding for RightFax (by Captaris) in Microsoft Access? RightFax is a faxing application that integrates with Outlook.
Although, I am fairly proficient in VBA, I've never worked the RightFax model. I've loaded the api and I'm ready ot go but to be honest, I'm not sure where to start.
Usually, I can plod through new adventures with the aid of the help files, forums such as this and whatever media is available. However, there doesn't seem to be a whole lot on RightFax available.

Any help on direction would be greatly appreciated.

Regards,
Mike
 
Mike - I'm also interested in using RightFax with Microsoft Access. Although you haven't had a reply to this post, I wondered if you had been able to figure out RightFax?

All I want to do (for now) is put code behind an Access form button to choose RightFax as the 'printer'. If you've made any progress and could lead me in the right direction, I would appreciate it.

Thanks,

Randy
 
I'd be more than happy to share what we've learned so far. As you noted, there weren't any responses to the posting and I still haven't found any help files but we have been able to work with it.

Actually I did find a couple of pdf files dealing with right fax. I will email them to you if you would like.

I'm not sure if you can set RightFax as a printer but here's a little piece of code that I'm using to send faxes through RightFax(via Outlook). Perhaps your button could trigger the sending of the fax. The CreateMail is my function to create the new outlook message. The FaxNum is being inserted as the recipient. Note the <NO COVER> variable. By inserting this into the body of the mail message, it removes the fax cover sheet.

Function FaxDocuments(strFileName As String)
On Error GoTo ErrorHandler
Dim dbs As DAO.Database, rst As DAO.Recordset, FaxNum As String, counter As Integer

Set dbs = CurrentDb()
Set rst = dbs.OpenRecordset(&quot;tblLetterInformation&quot;)

Call UpdateMessageForm(&quot;Faxing the Correspondence to &quot; & vbCrLf & vbCrLf & rst!Addr_Name & &quot; @ &quot; & Format(rst!Addr_Fax, &quot;000-000-0000&quot;))

FaxNum = rst!Addr_Name & &quot; (RightFax) [RFAX:&quot; & rst!Addr_Name & &quot;@/FN=1&quot; & rst!Addr_Fax & &quot;]&quot;

numDocuments = 1
strAttach(0, 0) = strFileName

Call CreateMail(FaxNum, &quot;&quot;, &quot;&quot;, &quot;<NOCOVER>&quot;, False, strAttach, numDocuments)

blnFax = False

DoCmd.Close acForm, &quot;frmMessage&quot;, acSaveNo

MsgBox &quot;The fax was successfully submitted to the RightFax Server. A copy of the fax is now in your sent mail folder.&quot; & vbCrLf & vbCrLf & &quot;If the fax number is correct, the recipient will receive the fax. If it is incorrect you will need to go into the sent mail folder and re-submit the documents manually from Outlook with the correct Fax Number.&quot;, vbInformation
ExitHere:
Exit Function
ErrorHandler:
MsgBox Err.Description

End Function
 
Hi,

I also want to send individual reports from Access to Rightfax. Each report is unique and each recipient of the report is unique. If anyone has any insight into this issue, I'd appreciate any and all responses or advice.

MIke,

Where did you obtain the Rightfax API install? I'd like to install it asap.

Would you mind posting the CreateMail procedure that you call or is it in the API?


Randy,

You may already have a solution to this issue by this time but if your form button initiates a report print, I did the following. I created a clone report of each report that I wanted to send by Rightfax. I then used the Page setup to assign the specific printer, Rightfax, to the clone report and simply called that report from the command button on the form to print it to Rightfax.


 
There is a couple of RightFax references listed in Access. I don't recall installing them. I assume that if you have RightFax installed they will become available.

Here is the CreatMail function that we use to send correspondence using Outlook:

You probably wont want to use the UpdateMessageForm function that is included in the FaxDocument code above. That is just used to update a message box that runs during the process.

Function CreateMail(strRecip As String, strCCRecip As String, strSubject As String, _
strMessage As String, blnDeleteSentCopy As Boolean, Optional strAttachments As Variant, Optional numAttachments As Integer, Optional strFrom As String) As Boolean
On Error GoTo ErrorHandler

Dim objNewMail As Outlook.MailItem
Dim blnResolveSuccess As Boolean
Dim objRecip As Recipient
Dim objAction As Action

CreateMail = True

Call DecideIfOutlookIsOpen

' Set global Application and NameSpace
' object variables, if necessary.
If golApp Is Nothing Then
If InitializeOutlook = False Then
MsgBox &quot;Unable to initialize Outlook Application or Namespace object variables!&quot;
End If
End If

Set golApp = New Outlook.Application
Set objNewMail = golApp.CreateItem(olMailItem)

With objNewMail
.Recipients.Add strRecip

If strCCRecip <> &quot;&quot; Then
Set objRecip = .Recipients.Add(strCCRecip)
objRecip.Type = olBCC
End If
If Not IsNull(strFrom) Then
.SentOnBehalfOfName = strFrom
End If
If Not IsMissing(strAttachments) Then
If IsMissing(numAttachments) Then numAttachments = 1
For numAttachments = 0 To numAttachments - 1

.Attachments.Add strAttachments(0, numAttachments)
Next
End If

blnResolveSuccess = .Recipients.ResolveAll
.Subject = strSubject
.Body = strMessage & Chr(13) & Chr(13)
.DeleteAfterSubmit = blnDeleteSentCopy
.ReadReceiptRequested = False
blnResolveSuccess = .Recipients.ResolveAll

If blnResolveSuccess Then
.Send
Else
MsgBox &quot;Unable to resolve all recipients. Please check the names.&quot;, vbCritical, &quot;Liberty LEADS&quot;
.Display
End If
End With

ExitHere:
Exit Function
ErrorHandler:
CreateMail = False
Resume ExitHere
End Function

Good luck, let me know if there is anything else that you need.

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top