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

VBA Automation?

12 views
Skip to first unread message

Christopher Aruffo

unread,
Sep 28, 1998, 3:00:00 AM9/28/98
to
I'm trying to automate a very simple WinFax send from Word 97, and
the SDK macros aren't much help since all the commands are
WordBasic.xxx. The SDK documentation describes all the methods in
the Send object, but doesn't seem to indicate how to actually send
anything.

My code is below. This may be painfully obvious to you as you look
at it, but why won't this send the active document?

cheers
chris

Sub FaxNow()
Dim Phax As Object
Set Phax = CreateObject("WinFax.SDKSend8.0")
Phax.SetPrintFromApp 1
Phax.SetSubject "Marp"
Phax.SetAreaCode "714"
Phax.SetCompany "New Nugget Co."
Phax.SetNumber "555-1212"
Phax.SetTo "Bobby Boy"
Phax.AddRecipient
Phax.Send 0
End Sub

Greg Longtin

unread,
Sep 29, 1998, 3:00:00 AM9/29/98
to
Chris,

Try the following code. Also, see the Delrina MS Office 97 macros if you
need some info on how to change printers.

It seems to work....

Greg Longtin (not from Delrina)

Option Explicit

Declare Sub SleepAPI Lib "kernel32" Alias "Sleep" (ByVal MSTime As Long)

Sub Main()
Dim oWFPSend As New wfxctl32.CSDKSend

With oWFPSend
.SetHold 1
.SetPrintFromApp 1

.SetTo "Greg Longtin"
.SetAreaCode "123"
.SetNumber "123-1234"
.SetCompany "Unknown"
.AddRecipient

.Send 0
Do While .IsReadyToPrint = 0 ' Don't remove
DoEvents ' Don't remove
Loop ' Don't remove
' Excel97 Command ********************
' ActiveSheet.PrintOut

' Word97 command ********************
ActiveDocument.PrintOut

SleepAPI 200 ' Don't remove - tried 50, Send Dialog!
.Done
SleepAPI 200 ' Don't remove - tried 50, Send Dialog!
End With
Set oWFPSend = Nothing
End Sub

Christopher Aruffo wrote in message <980828061557.9672079781@servicenews>...

Larry Gordon

unread,
Sep 29, 1998, 3:00:00 AM9/29/98
to
Greg

Thanks for your code, I wasn't the one who asked, however your answer gave
me some info I was looking for. The main thing I got from your code was
your diminsioning 'Dim oWFPSend As New wfxctl32.CSDKSend' which allowed me
to access a pull down list of methods.

I do have one quandry though. How do I print an Access Report. I tried
your code with access code and it wouldn't allow me to fax the Access
report. I replaced your one line with two Access lines. It just printed
the report to my current printer.

replaced "ActiveDocument.PrintOut"

DoCmd.SelectObject acReport, "Report1", False
DoCmd.PrintOut

Any suggestions would be greatly appreciated.

Thanks
Larry Gordon <lar...@kcnet.com>


Greg Longtin <lon...@worldnet.att.net> wrote in article
<6uqu1s$51k$1...@service.symantec.com>...

0 new messages