Generating an Export Menu

<< Click to Display Table of Contents >>

 

Generating an Export Menu

To use this feature, write the following script.

Sub Rectangle3_Click()
  Set report = Application.LoadReport("[Report3]")
  Select Case _
    Application.SelectMenu("PDF|Excel|HTML|RTF|Text|_
      TIFF|Text(CSV)")
    Case 1
      Report.Export "PDF", "c:\mail\reports\report.pdf"
      MsgBox "Exported to PDF!"
    Case 2
      Report.Export "EXCEL", "c:\mail\reports\report.xls"
      MsgBox "Exported to XLS!"
    Case 3
      Report.Export "HTML", "c:\mail\reports\report.html"
      MsgBox "Exported to HTML!"
    Case 4
      Report.Export "RTF", "c:\mail\reports\report.rtf"
      MsgBox "Exported to RTF!"
    Case 5
      Report.Export "TEXT", "c:\mail\reports\report.txt"
      MsgBox "Exported to Text (CSV)!"
    Case 6
      Report.Export "TIFF", "c:\mail\reports\report.tiff"
      MsgBox "Exported to TIFF!"
    Case 7
      Set reportFilter = report.GetExportFilter("TEXT")
      reportFilter.FileName="c:\mail\reports\_
        report2.txt"
      reportFilter.TextDelimiter = ","
      report.Export reportFilter
      MsgBox "Exported to TXT using a filter!"
  End Select
End Sub

Was this page useful?