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

NEED HELP WITH REPORT EMAILING ETC!!!!

Status
Not open for further replies.

tatty

Technical User
Mar 31, 2000
9
GB
Okay people, here it goes..... brief outline of what I am trying to do....

I have a Management Information DB that stores service standards for the months. Each Client has approx 9-10 seperate reports (each containing different things i.e attached to a word doc for commentary's or a Contents list, report showing %'s (created using the report wizard)) etc, etc, etc, blar, blar, blar!!!

Anyway, I used to just print out the seperate reports and photocoy and bind the reports to send by post but now I need to devise a way to send these 9-10 reports via email.

Now, I have tried setting up a main report and inserting each seperate report as sub reports, but because some of the reports contain page headers and footers containing column names and section numbers (which cannot be inserted into the report header/footer, before you suggest that!!!) When I insert these reports as sub reports, these PGHeaders/Footers do not show up!!!


Hopefully you are getting this so far!!!


Anyway, the other alternative is to buch all 9-10 reports into just one email attachment??!?!

Just one more thing, the company I work for would really like to use Snapshot Viewer only to email the reports, as this is a small package that we can also email to the Clients aswell.

Any ideas anyone?? Anyone?? Please???

:) :) :) :)
 
This will send To, CC and BC as well as Subject, Message, and Attachment
You need 6 text boxes or variables which match the following:
txtMainAddresses
txtCC
txtBCC
txtSubject
txtBody
txtAttachment

Put this in your Module
------------------------------
Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
------------------------------
put this in a command button
------------------------------
Private Sub Command0_Click()
On Error GoTo Err_Command0_Click

Dim stext As String
Dim sAddedtext As String
If Len(txtMainAddresses) Then
stext = txtMainAddresses
End If
If Len(txtCC) Then
sAddedtext = sAddedtext & "&CC=" & txtCC
End If
If Len(txtBCC) Then
sAddedtext = sAddedtext & "&BCC=" & txtBCC
End If
If Len(txtSubject) Then
sAddedtext = sAddedtext & "&Subject=" & txtSubject
End If
If Len(txtBody) Then
sAddedtext = sAddedtext & "&Body=" & txtBody
End If
If Len(txtAttachment) Then
sAddedtext = sAddedtext & "Attach=" & Chr$(34) & Me!txtAttachment & Chr$(34)
End If

stext = "mailto:" & stext

If Len(sAddedtext) <> 0 Then
Mid$(sAddedtext, 1, 1) = &quot;?&quot;
End If

stext = stext & sAddedtext

' launch default e-mail program
If Len(stext) Then
Call ShellExecute(Me.hwnd, &quot;open&quot;, stext, vbNullString, vbNullString, SW_SHOWNORMAL)
End If

Exit_Command0_Click:
Exit Sub

Err_Command0_Click:
MsgBox Err.Description
Resume Exit_Command0_Click

End Sub

------------------------------

DougP, MCP

Visit my WEB site to see how Bar-codes can help you be more productive
 
Thanks DougP, I'll let you know what the outcome is!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top