vb6 fax/email problem
vb6 fax/email problem
(OP)
I was handed a VB6 application that faxes up to 100 customers a night. The previous programmer put text into a richtextbox then faxed it page by page using FaxManJr until it was completely sent. It works okay.
Problem now is that some of these customers want the same information emailed instead of faxed to them, but I need to keep the current ability to fax for those that don't. Seems easy enough.
Here is what I have tried using clsSendMail to email:
-Putting richtextbox text into message body and then emailing. PROBLEM: The page is no longer formatted and with the email header, it splits the pages in undesired places. Would work okay if page breaks could be added.
-Using cutePDF to save individual pages as PDFs and sending as attachments. PROBLEM: CutePDF prompts for file name when saving and there might be on any givin night up to 100 of these. Need more automation.
I have been doing reseqarch for a few day on this and I am stuck on where I should look next. This seems like it should be a fairly easy project, but I am banging my head against the wall right now.
Could someone lead me in the right direction or give me some links that I should look at?
Thanks
Steve
Problem now is that some of these customers want the same information emailed instead of faxed to them, but I need to keep the current ability to fax for those that don't. Seems easy enough.
Here is what I have tried using clsSendMail to email:
-Putting richtextbox text into message body and then emailing. PROBLEM: The page is no longer formatted and with the email header, it splits the pages in undesired places. Would work okay if page breaks could be added.
-Using cutePDF to save individual pages as PDFs and sending as attachments. PROBLEM: CutePDF prompts for file name when saving and there might be on any givin night up to 100 of these. Need more automation.
I have been doing reseqarch for a few day on this and I am stuck on where I should look next. This seems like it should be a fairly easy project, but I am banging my head against the wall right now.
Could someone lead me in the right direction or give me some links that I should look at?
Thanks
Steve
RE: vb6 fax/email problem
Are you setting AsHTML true?
From the help doc
Set this property to true if your message is formatted as HTML text and you want the receiving email client to interpret the email as HTML instead of plain text. You must also make sure the message text includes valid HTML tags. For example, setting this property to true and setting the Message Property to “Hello There” will be interpreted as plain text. To send your message as HTML you must set this property to true and set the message property to valid HTML, something like:
<HTML><BODY><B>Hello There</B></BODY></HTML>
You can embed images, etc. by using the AsHTML Property and the Attachment Property together. When AsHTML is True the Attachment Property is used to embed files called out in the HTML code. The message text is scanned for file names that match the file names set via the Attachment Property.
RE: vb6 fax/email problem
RE: vb6 fax/email problem
RE: vb6 fax/email problem
RE: vb6 fax/email problem
RE: vb6 fax/email problem
RE: vb6 fax/email problem
RE: vb6 fax/email problem
RE: vb6 fax/email problem
RE: vb6 fax/email problem
Or just email a link, or a link for each file, to them and let them pull-them-in-from/view-them-on a server/homepage themselves.
RE: vb6 fax/email problem
RE: vb6 fax/email problem
http://ww
Swi
RE: vb6 fax/email problem
Bob
RE: vb6 fax/email problem
RE: vb6 fax/email problem
Swi
RE: vb6 fax/email problem
CODE
Private Sub Command1_Click()
CreateEmptyZip "c:\testzip.zip"
With CreateObject("Shell.Application")
.NameSpace("c:\testzip.zip").CopyHere "c:\test.txt"
' .NameSpace("c:\testzip.zip").CopyHere .NameSpace(FolderName).items 'use this line if we want to zip all items in a folder into our zip file
End With
' All done!
End Sub
Public Sub CreateEmptyZip(sPath)
Dim strZIPHeader As String
strZIPHeader = Chr$(80) & Chr$(75) & Chr$(5) & Chr$(6) & String(18, 0) ' header required to convince Windows shell that this is really a zip file
With CreateObject("Scripting.FileSystemObject")
.CreateTextFile(sPath).Write strZIPHeader
End With
End Sub
RE: vb6 fax/email problem
Swi
RE: vb6 fax/email problem
RE: vb6 fax/email problem
One other question. Is this only XP compliant code or will it work with prior versions of windows?
Swi
RE: vb6 fax/email problem
RE: vb6 fax/email problem
I would still use a 3rd party zip executable to zip the files if emailing to 100+ customers.
RE: vb6 fax/email problem
>3rd party zip executable to zip
3rd party zip
RE: vb6 fax/email problem
Why?
RE: vb6 fax/email problem
>XP specific
No, but it is Shell specific, so you need to be XP or later ... (which nowadays would mean XP, W2K3, Vista and, I believe, W2K also works - so you ony really miss out on the frankly obsolete 16-bit OSs and NT4)
>it will automatically apply a zipping condensation algorithm when storing the file?
Exactly so. Try it, and see what happens ...
RE: vb6 fax/email problem
RE: vb6 fax/email problem
Swi
RE: vb6 fax/email problem
RE: vb6 fax/email problem
I got a little bit curious, though. I tried creating an empty zip file, reading the text file into a string, and then attempted to write to the zip file using the TextStream object's Write method. I got a "bad file mode" error, which kind of makes sense if the write method can't apply a condensing algorithm. Am I to conclude from this that the CopyHere method is smart enough to apply a condensing algorithm when it encounters the string header?
RE: vb6 fax/email problem
the one I'm leveraging here is the CompressedFolder extension, which lives in zipfldr.dll in System32, and has a CLSID of {E88DCCE0-B7B3-11d1-A9F0-00AA0060FA31}
Oh, and if you have a poke around HKEY_CLASSES_ROOT\.zip you should see where I got the header string from
RE: vb6 fax/email problem
RE: vb6 fax/email problem
Private Sub CbUnZip_Click()
With CreateObject("Shell.Application")
.NameSpace(CurDir$ & "\Dest").CopyHere .NameSpace(CurDir$ & "\testzip.zip").items
End With
End Sub
regards Hugh
RE: vb6 fax/email problem
regards Hugh
RE: vb6 fax/email problem
RE: vb6 fax/email problem
Using the "Shell.Application" method, how can I surpress the "Confirm File Replace" dialog message that appears if a file already exist in a zip? I do want to replace.
RE: vb6 fax/email problem
Thanks in advance.
RE: vb6 fax/email problem
RE: vb6 fax/email problem
RE: vb6 fax/email problem
RE: vb6 fax/email problem
downlaw, just append a blank string to the start of the parameter in MS Access like so:
With CreateObject("Shell.Application")
.NameSpace("" & zipFile).CopyHere normalFile
End With