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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vb6 fax/email problem 4

Status
Not open for further replies.

smeyer56

IS-IT--Management
Oct 16, 2002
206
US
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


 
If you are using the same thing as me.
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.
 
The message is currently formatted as rtf so sending as html doesn't work
 
That could work but it doesn't allow me to place a page break. Still have the same problem, it is now formatted but when a page is printed, the page splits in undersired places.
 
Well why can't you just send it as an RTF file attachment?
 
Would possibly work except the files are 550k and 1 email might have 15-20 attachments.
 
Well, neither a PDF or HTML file are going to solve that one ...

 
Why not just zip the rtf files all together and send the one zip? I personally would rather have that sent to me rather than an email with 20 attachments or 20 emails.
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.
 
I have not tried zipping, do you have any links to doing that in VB6. I cannot use links because I don't want to place these files on the web server.
 
Coo, all these 3rd party tools when you can get Windows to do it for you ...
 
Heh! That request came a lot faster evan than I expected. OK, here's an illustrative example:
Code:
[blue]Option Explicit

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[/blue]
 
The less I have to rely on 3rd party tools the better. Thanks for sharing.

Swi
 
Just a second here, strongm. So, you're saying that when the FileSystemObject gets convinced that this is really a zip file, it will automatically apply a zipping condensation algorithm when storing the file?
 
strongm,

One other question. Is this only XP compliant code or will it work with prior versions of windows?

Swi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top