P
Pamela
I created a cmd button using the wizard to send the specified report. We
then choose Excel as the format/program to write it and it automatically
opens Outlook at attaches our report as a spreadsheet to a New Message. The
spreadsheet version of our report, however, doesn't keep the landscape
setting. I tried searching for help on it and found some code that looked
similar to what I am trying to accomplish and pasted it into my OnClick
event, but it isn't working...Please Help!! How can I do this all
automatically?? Thanks so much!
Here's is my code:
Private Sub MailtoTim_Click()
On Error GoTo Err_MailtoTim_Click
Dim stDocName As String
stDocName = "rpt_OpenAssnsAll"
DoCmd.SendObject acReport, stDocName
appxls.ActiveSheet.PageSetup.PrintArea = ""
With appxls.ActiveSheet.PageSetup
.Orientation = xlLandscape
.PaperSize = xlPaperLegal
End With
Exit_MailtoTim_Click:
Exit Sub
Err_MailtoTim_Click:
MsgBox Err.Description
Resume Exit_MailtoTim_Click
End Sub
Thanks again!
Pamela
then choose Excel as the format/program to write it and it automatically
opens Outlook at attaches our report as a spreadsheet to a New Message. The
spreadsheet version of our report, however, doesn't keep the landscape
setting. I tried searching for help on it and found some code that looked
similar to what I am trying to accomplish and pasted it into my OnClick
event, but it isn't working...Please Help!! How can I do this all
automatically?? Thanks so much!
Here's is my code:
Private Sub MailtoTim_Click()
On Error GoTo Err_MailtoTim_Click
Dim stDocName As String
stDocName = "rpt_OpenAssnsAll"
DoCmd.SendObject acReport, stDocName
appxls.ActiveSheet.PageSetup.PrintArea = ""
With appxls.ActiveSheet.PageSetup
.Orientation = xlLandscape
.PaperSize = xlPaperLegal
End With
Exit_MailtoTim_Click:
Exit Sub
Err_MailtoTim_Click:
MsgBox Err.Description
Resume Exit_MailtoTim_Click
End Sub
Thanks again!
Pamela