Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Access 97 Fax Report / VBA Code

11 views
Skip to first unread message

Larry Gordon

unread,
Sep 29, 1998, 3:00:00 AM9/29/98
to
Attached is some VBA code that works, I'm just having 3 problems I hope
someone can help me with.

1) I can send a cover and attachments with now problem, however I haven't
found a way to fax a report that is in preview mode from Access 97. I
tried the following to no avail.
.SetPrintFromApp (1)
DoCmd.SelectObject acReport, "Report1", False
DoCmd.PrintOut

2) Dates: I can't seem to set the date / time on faxes - I must be doing
something wrong. Below is the code I'm using.
.SetDate ("09/20/98")
.SetTime ("10:15:00")

3) I've read the SDK documentation and I can not find where you can set the
person who the fax is from. I know the from is setup when the program is
setup, but my customer wants to setup where different people from the same
organizations send faxes and the fax shows the real person it is from. How
do I set this in code?

Thanks in advance for any help
Larry Gordon <lar...@kcnet.com>

P.S. When I started this project a few days ago I had a real hard time
finding code that would work in Access 97 - Here is some that works. I
need to thank Christopher Aruffo, Greg Longtin, and Eric C.

Public Function FaxNow()

Dim strFaxAreaCode As String
Dim strFaxNmb As String
Dim strTo As String
Dim strCompany As String

Dim strCoverPgTxt As String
Dim strCoverFile As String
Dim strCoverSubject As String

Dim strAttachFile As String
Dim intDelete As Integer
Dim strSubject As String

Dim strSendDate As Date
Dim strSendTime As Date
Dim intResolution As Integer


'--- Date Time
strSendDate = #9/20/98#
strSendTime = #9:57:00 AM#


'---- To:
strFaxAreaCode = ""
strFaxNmb = "764-7515"
strTo = "Joe Blow"
strCompany = "Gordon Energy & Drainage"

'---- coverpage Info
strCoverPgTxt = "This is a test"
strCoverFile = "C:\Program Files\Symantec\WinFax\Cover\_BusComp3.CVP"
strCoverSubject = "This is the Subject Line of the test App"

'---- Attachment File
strAttachFile = "f:\word\a.doc"

'---- How Winf Fax works
intDelete = 1 '1= Delete fax after sending successfully 0=keep (0
default)
intResolution = 1 '1= Fine Resolution 0=standard resolution ' (0
default)

'=========================================================
'setup winfax
Dim oWFPSend As New wfxctl32.CSDKSend

With oWFPSend
'.SetPrintFromApp (1)

'Time & Date ******* Not Working
'.SetDate (Format(strSendDate, "mm/dd/yyyy"))
'.SetTime (Format(strSendTime, "hh:nn"))
.SetDate ("09/20/98")
.SetTime ("10:15:00")

'To:
'Fax Number
.SetAreaCode (strFaxAreaCode)
.SetNumber (strFaxNmb)

.SetCompany (strCompany)
.SetTo (strTo)

'Add Recipient - You can loop through and add multiple recipiants
.AddRecipient

'Cover Page Info
.SetCoverText (strCoverPgTxt) ' If the next 3 lines are not sent to win
fax there will be no cover page
.SetSubject (strCoverSubject)
.SetCoverFile (strCoverFile) ' Note if file is not specified the quick
cover will print

'Attachment
.AddAttachmentFile (strAttachFile)

'WinFax Options
.SetDeleteAfterSend (intDelete)
.SetResolution (intResolution)
'.SetPrintFromApp (1)

'------------------------------------------
'below is an attemp to print an access report that is open in preview
'It does not work - Once I find a solution I post it.
'DoCmd.SelectObject acReport, "Report1", False
'DoCmd.PrintOut
'------------------------------------

.Send (0)
End With

End Function

0 new messages