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


 
There's nothing in this code that would be XP specific, unless the header line differs from opsys to opsys. If that were so, I'm sure strongm would have mentioned it.
 

I would still use a 3rd party zip executable to zip the files if emailing to 100+ customers.
 
>I would still use a 3rd party zip executable to zip the files if emailing to 100+ customers.

Why?
 
Sberthold said:
I would still use a 3rd party zip executable to zip the files if emailing to 100+ customers
Why?

>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 ...
 
Got a slow day tomorrow...I'll do it then and post back results for those interested.
 
strongm, thanks again. I would assume that with some modification this could be set up to unzip files as well or do you have an example of that as well? :)

Swi
 
Just to clarify slightly Bob: it is the Windows shell that does the zip handling, not the FileSystemObject
 
Aha, that makes more sense to me. Well, that's nifty. I just tried it and of course it works. Thanks for sharing.

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?

 
You might want to start investigating Shell Namespace Extensions ...

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
 
This seems to be doing an unzip for me;

Private Sub CbUnZip_Click()

With CreateObject("Shell.Application")
.NameSpace(CurDir$ & "\Dest").CopyHere .NameSpace(CurDir$ & "\testzip.zip").items
End With

End Sub

regards Hugh
 
Zip and UnZip using CopyHere as described above both working for me under XP but niether working under Win 2000.

regards Hugh
 
As I hinted, I wasn't certain that it worked under 2000 - but given that mainstream support for 2000 terminated over a year ago Ihave to say I'm not too surprised or too concerned ...
 
Hey strongm
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.
 
I'm bumping this. I am having the same problem as Creepers in that I want to overwrite every time. My program involves many, many overwrites, handling the file data in between each one.

Thanks in advance.
 
Oh thanks, I think I was looking for snippets of code when I scanned and missed that.
 
Thanks strongm. This even works is MS Access 2003. The only problem I am having with it is that the ".NameSpace" parameter will not take a variable. I have to put quotes around a path and filename. It does not work dynamically.
 
> The only problem I am having with it is that the ".NameSpace" parameter will not take a variable. I have to put quotes around a path and filename. It does not work dynamically.


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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top