- This topic is empty.
-
AuthorPosts
-
January 31, 2002 at 6:06 pm #2689
daverch
MemberSet objWinfaxSend = Server.CreateObject(“WinFax.SDKSend”)
objWinfaxSend.SetCoverText desc
objWinfaxSend.SetSubject “Invoice ” & InvId
objWinfaxSend.SetCountryCode “”
objWinfaxSend.SetAreaCode “”
objWinfaxSend.SetNumber Request.Form(“Email”)
objWinfaxSend.SetTo oObject(“CusName”)
objWinfaxSend.MakeAttachment(“c:redbackwebipindex.htm”)
objWinfaxSend.AddRecipient
objWinfaxSend.Send 0
Set objWinfaxSend = NothingFebruary 1, 2002 at 4:13 am #4559Anonymous
MemberIf you are using IE, this will not work since it will prompt you with a print dialog. You will need to print html using the printer driver + web browser control.
or, you can use Netscape instead.February 5, 2002 at 12:01 am #4560daverch
MemberI changed to code as follows and it converts the output. However, I get prompted on the console for the printer to print to:
Set objWinfaxSend = Server.CreateObject(“WinFax.SDKSend8.0”)
objWinfaxSend.SetCoverText “Invoice Attached”
objWinfaxSend.SetSubject “Invoice ” & InvId
objWinfaxSend.SetDeleteAfterSend 1
objWinfaxSend.SetCountryCode “”
objWinfaxSend.SetAreaCode “”
objWinfaxSend.SetNumber Request.Form(“Email”)
objWinfaxSend.SetTo oObject(“CusName”)
objWinfaxSend.AddAttachmentFile “c:tempfax.htm”
objWinfaxSend.AddRecipient
objWinfaxSend.Send 0
objWinfaxSend.Done
Set objWinfaxSend = NothingFebruary 5, 2002 at 3:26 pm #4561Anonymous
MemberAre you using IE as your Web browser?? if so, it will always show the print dialog box.
April 5, 2002 at 10:15 am #4562kiwi
MemberRe: Internet Explorer always asking for the print dialog to send html, this isn’t necessarily true. Through OLE you can ask Internet Explorer to print without user interaction. Here’s the pseudocode:
IWebBrowser2.ExecWB(IDM_PRINT, OLECMDEXECOPT_DONTPROMPTUSER);
I’m not an OLE guru — is there a way to modify the WinFax method so it uses this nice convenient ‘Dont Prompt User’ option?
April 6, 2002 at 1:43 am #4563Anonymous
Memberyes this will work, but in this case you are not adding as an attachment, you are printing to the Winfax driver directly instead.
winfax uses the “Print To” method to add attachments on the fly, this is the same as right-clicking a file and selecting print. (You can do this for associated files, like .TXT, .DOC, HTML etc.) In the case for HTM files (when IE is the associated program) , the “Print” dialog appears and there is no way around this if you plan on using this method.
April 9, 2002 at 10:17 am #4564kiwi
MemberHi all.
Ok really simple thing then.. I tried using Winfax with an HTML attachment in VBA from Word (since VBA is virtually identical to VB) but with no success.
Here’s the code, I have hooked up to a button in Word:
Private Sub TestFax_Click()
Set objWinfaxSend = CreateObject(“WinFax.SDKSend”)
objWinfaxSend.SetCoverText “Invoice Attached”
objWinfaxSend.SetSubject “Invoice ” & InvId
objWinfaxSend.SetDeleteAfterSend 1
objWinfaxSend.SetCountryCode “”
objWinfaxSend.SetAreaCode “”
objWinfaxSend.SetNumber “whatever”
objWinfaxSend.SetTo “CusName”
objWinfaxSend.AddAttachmentFile “C:test.html”
objWinfaxSend.AddRecipient
ret = objWinfaxSend.Send(0)
‘ was there an error?
If ret <> 0 Then
MsgBox “There was an Error”, vbOKOnly
Else
MsgBox “Fax has been sent!”, vbInformation
End If
objWinfaxSend.Done
Set objWinfaxSend = NothingEnd Sub
I tried WinFaxSDK.Send and the same with 8.0 on the end to the same effect: Netscape 6.2’s splash screen appears but then WinFax says ‘printing failed you have to launch the app and choose print yourself’…
Anyone had any luck with Netscape 6.2? I have the same problems with Mozilla 0.9.9…
BTW some background: I ultimately don’t want to do this in Word, I will be doing it in Java with the JACOB bridge but I wanted to check that it worked from VB first and then translate it (Jacob is JVM-independent API for supporting Microsoft extensions for java).
April 10, 2002 at 4:21 am #4565Anonymous
MemberTry this:
Private Sub TestFax_Click()
Set objWinfaxSend = CreateObject(“WinFax.SDKSend”)
objWinFaxSend.ClientID(“WinFax”)
objWinfaxSend.SetCoverText “Invoice Attached”
objWinfaxSend.SetSubject “Invoice ” & InvId
objWinfaxSend.SetDeleteAfterSend 1
objWinfaxSend.SetCountryCode “”
objWinfaxSend.SetAreaCode “”
objWinfaxSend.SetNumber “whatever”
objWinfaxSend.SetTo “CusName”
objWinfaxSend.AddAttachmentFile “C:test.html”
objWinfaxSend.AddRecipientret = objWinfaxSend.Send(1)
‘ was there an error?
If ret <> 0 Then
MsgBox “There was an Error”, vbOKOnly
Else
MsgBox “Fax has been sent!”, vbInformation
End If‘ Wait until the EntryID is ready before moving on.
‘ the Send(1) you specified before is used here.
‘ We don’t care what the EntryID is,
‘ we just want to know that is it ready.
‘ this loop will wait but allow background processing to continue
‘ when ready IsEntryIDReady is not = to 1Do While objWinFaxSend.IsEntryIDReady(0) <> 1
DoEvents
LoopobjWinfaxSend.Done
Set objWinfaxSend = NothingEnd Sub
[/quote] -
AuthorPosts
- You must be logged in to reply to this topic.