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

emailing report in XP problem

Status
Not open for further replies.

sggaunt

Programmer
Jul 4, 2001
8,620
GB
Hello

We are setting up access 97 to email a report, using sendobject, but it dose not seem to work correctly on a Windows XP station, is fine on W98 and seems to work (after conversion) on another XP machine running Access 2000.

Does anyone know if there are there compatibility issues between Access 97 and XP ??

Steve.
 
Can you please explain "does not seem to work correctly". We use Access97 with OfficeXP (except Access) and WindowsXP with no problem. We don't use SendObject.
 
The error message we recive (XP machine running access 97) is 'Microsoft Access can't open mail session'.
Our default mail client is Outlook Express.

Do you know of any other way to email a report from within access other than using SendObject ?

Steve.

 
This code creates the e-mail attaches (1)file that is unique to the individual receiptment and (1) file that is common to all receiptants. It uses the common dialog box to choose the common file. The e-mail address are kept in the DB. Be sure that in your References that you have selected Outlook.

Dim Atchfile As String
Dim IntFile As String
Dim Message As String
Dim App As Object
Dim ITM As Object
Dim DB As Database
Dim Regnme As Recordset
Dim Esubject As String
Dim SendTo As Variant
Dim Ebody As String
Dim NewFileName As String
Set Xfile = GetObject(, "Excel.application")
With Xfile.ActiveWorkbook
Atchfile = .Path
End With
If Me!Check15 <> -1 Then
Message = MsgBox("You Have Not Put A Check In The All Jurisdictions Selected Box Yet.", vbOKOnly)
GoTo Exit_CmdEstart_Click
End If

CommonDialog1.CancelError = True
CommonDialog1.InitDir = Atchfile
CommonDialog1.Flags = &H1000& Or &H800&
CommonDialog1.Filter = "All PDF Files (*.pdf)|*.pdf|Word Files (*.doc)|*.doc"
CommonDialog1.DialogTitle = " Select The Interest Report. "
CommonDialog1.ShowOpen
IntFile = CommonDialog1.Filename
Set DB = CurrentDb
Set Regnme = DBEngine(0).Databases(0).OpenRecordset("qrypickJuris")
With Regnme
If .RecordCount > 0 Then
.MoveFirst
Do Until .EOF
SendTo = !EMailAddr 'SendTo & !EMailAddr & ";"
' .MoveNext
' Loop
' End If
'End With
Esubject = "YourSubject"
Ebody = " The attached Summary is for" & " " & Me.TxtTpName & ", " & "their account number is " & Me.TxtLinNo & " and covers the years " & Me.TxtYrs & "." _
& vbCrLf & vbCrLf & vbCrLf _
& " EMAIL Confidentiality: " _
& "This communication may contain privileged information. " _
& "If you are not the intended recipient, or believe that you may have " _
& "received this communication in error, please reply to the sender " _
& "indicating that fact and delete the copy you received. In addition, " _
& "you should not print, copy, retransmit, disseminate or otherwise use the information in this communication."

NewFileName = Atchfile & "\" & "Juris" & " " & !JurisID & ".pdf"

Set App = CreateObject("Outlook.Application")
Set ITM = App.CreateItem(olMailItem)

With ITM

.Subject = Esubject
.To = SendTo
.Body = Ebody
.Attachments.Add NewFileName
.Attachments.Add IntFile
.Display 'This opens the e-mail for viewing
' .Send 'This sends without opening the e-mail (you will get the prompt)
End With
SendKeys "%{s}", True 'This sends the e-mail (won't work if you are stepping through)
.MoveNext
Loop
End If
End With


Set Xfile = Nothing
Set ITM = Nothing
Set App = Nothing
Regnme.Close
Set Regnme = Nothing

End
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top