funkmonsteruk
IS-IT--Management
I've just set up some reports in BO 5.1.3 to run automatically overnight. I was given some code to acheive this and i have been using this facility to update information on an iternet page, this is how the code looks at the moment
Dim Doc as Document
Dim Rep as Report
Set Doc = Application.Documents.Item(1)
Doc.Refresh
Doc.Save
Set Rep = Doc.Reports.Item(1)
Rep.ExportAsHtml ("F:\Public\Probate Intranet\Account Balances Report"
Application.Quit
I now need this report to do two more things: Firstly i need it to save as and use the date it was produced as part of the document name (eg AccountBalances_29/08/2002). The secound thing i need to do is automatically print the report, i have tried Doc.Printout underneath the Doc.Save line but this only works if i step through the code and not if i include it in a document open routine.
Can anyone help me with this problem?
Dim Doc as Document
Dim Rep as Report
Set Doc = Application.Documents.Item(1)
Doc.Refresh
Doc.Save
Set Rep = Doc.Reports.Item(1)
Rep.ExportAsHtml ("F:\Public\Probate Intranet\Account Balances Report"
Application.Quit
I now need this report to do two more things: Firstly i need it to save as and use the date it was produced as part of the document name (eg AccountBalances_29/08/2002). The secound thing i need to do is automatically print the report, i have tried Doc.Printout underneath the Doc.Save line but this only works if i step through the code and not if i include it in a document open routine.
Can anyone help me with this problem?