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

Want to export, change file permissions at DOS, then Email it

Status
Not open for further replies.

polyquoter

Programmer
Feb 4, 2001
14
0
0
US
I am using VB6 with Crystal Reports Version 7. I'm exporting a report to a Rich Text File (RTF) and then
e-mailing it as an attachment. Do you know what kind of an OS call I could make from VB6 to write protect this file before it is sent off in the E-mail? I'm just not sure how to export the file, change the permissions and then send it on as an attachment.

My code currently exports and sends exported file as an attachment. It follows:

EmailQuot.DataFiles(0) = "C:\Vatc\quotprt.mdb"
EmailQuot.EMailSubject = mysubject.Text
EmailQuot.EMailToList = tolist.Text
EmailQuot.EMailCCList = cclist.Text
EmailQuot.EMailMessage = mymessage.Text
EmailQuot.Action = MESSAGE_SEND

My destination is to MAPI.
My Print To File PrintFileName is Quote and
PrintFileType is RTF.

The above works great - I just need to keep people on the receiving end from altering the RTF quote file - or at least make it hard for them to alter it.

Thanks in advance for any suggestions!





 
I don't know if this is of any use to you but you might try the following:

Add a reference to Microsoft Scripting Runtime in your VB Project the code the following to make the file Read-Only.

Code:
Dim FSO As New FileSystemObject
dim mFile As File

Set mFile=FSO.GetFile(&quot;<file name&quot;>
mFile.Attributes = ReadOnly

As to your requirement to EMAIL. I have been working with the Microsoft MAPI Controls recently and I seem sure that you could send the file as an attachment via one of these controls.

Hope this is of use to you. John Whyte
jwhyte@skipton.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top