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

Error viewing snapshot file using OutputTo/ cdonts

Status
Not open for further replies.

JSD1976

Programmer
Aug 17, 2004
16
0
0
US
Hello

I am tryung to send a report as an attachment. I ran into trouble only at the end, when I got an error after an attempt to view the attachment. Perhaps someone can see it:

Private Sub Report_Activate()
DoCmd.OutputTo acOutputReport, "DateChng", acFormatSNP, "H:\Dbases\Day_Prod\reports\DateChanges.snp", False

Dim CountData As Integer
Dim CountCartons As Integer
Dim DataAddress As String


Const cdoSendUsingMethod = " _
cdoSendUsingPort = 2, _
cdoSMTPServer = "
'// Create the CDO connections.
Dim iMsg, iConf, Flds
Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields

'// SMTP server configuration.
With Flds
.Item(cdoSendUsingMethod) = cdoSendUsingPort

'// Set the SMTP server address here.
.Item(cdoSMTPServer) = "192.168.30.140"
.Update
End With

'// Set the message properties.
With iMsg
Set .Configuration = iConf
.To = "mfg_update@SuperiorProd.com"
.From = "Production@SuperiorProd.com"
.Subject = "Date Changed Report"
End With

'// An attachment can be included.
iMsg.AddAttachment "H:\Dbases\Day_Prod\reports\DateChanged.snp"

'// Send the message.
iMsg.Send ' send the message.-

End Sub


I can view the file if I open it from the network, but not if I open it as the email attachment. Any ideas what could be wrong?

Many thanks

Jeremy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top