I have outlook module that sends out forms... I have many different forms in the database.. in order to do what i needed i Save the Report as a PDF on my server, then delete file once attached to my email.. That being said as you see below i had to hard code the "save path" name in.. Is there a way for me to put this in a single table so it can be edited by admin in the sys_config section of my database? Here is the code..
Private Sub EmailDestinationRelease(Reportname As String)
On Error GoTo ErrorRoutine
Dim STRDOCNAME As String
Dim STRCRITERIA As String
Dim ReportNamesave As String
Dim SavePathName As String
On Error GoTo ErrorRoutine
ReportNamesave = Form_ExpBooking.UltimateCarrierRef & " Destination Release"
SavePathName = "\\Server\AecLogistics\TempFiles\ " & ReportNamesave & ".pdf"
STRDOCNAME = Reportname
STRCRITERIA = "ExpBooking.ID =" & Form_ExpBooking.ID
DoCmd.OpenReport STRDOCNAME, acViewPreview, , STRCRITERIA
DoCmd.OutputTo acOutputReport, Reportname, acFormatPDF, SavePathName, False, , , acExportQualityPrint
SendEmailMessage True, SavePathName
Kill SavePathName
ErrorRoutine:
Exit Sub
End Sub
The line in question is
SavePathName = "\\Server\AecLogistics\TempFiles\ " & ReportNamesave & ".pdf"
Could i write someway the "\\Server\AEClogistics\tempfiles\ " in a table and just reference that there?
Private Sub EmailDestinationRelease(Reportname As String)
On Error GoTo ErrorRoutine
Dim STRDOCNAME As String
Dim STRCRITERIA As String
Dim ReportNamesave As String
Dim SavePathName As String
On Error GoTo ErrorRoutine
ReportNamesave = Form_ExpBooking.UltimateCarrierRef & " Destination Release"
SavePathName = "\\Server\AecLogistics\TempFiles\ " & ReportNamesave & ".pdf"
STRDOCNAME = Reportname
STRCRITERIA = "ExpBooking.ID =" & Form_ExpBooking.ID
DoCmd.OpenReport STRDOCNAME, acViewPreview, , STRCRITERIA
DoCmd.OutputTo acOutputReport, Reportname, acFormatPDF, SavePathName, False, , , acExportQualityPrint
SendEmailMessage True, SavePathName
Kill SavePathName
ErrorRoutine:
Exit Sub
End Sub
The line in question is
SavePathName = "\\Server\AecLogistics\TempFiles\ " & ReportNamesave & ".pdf"
Could i write someway the "\\Server\AEClogistics\tempfiles\ " in a table and just reference that there?