Gerando um Menu Exportar

<< Clique para Mostrar o Sumário >>

 

Gerando um Menu Exportar

Para utilizar este recurso, escreva o script a seguir.

Sub Retangulo3_Click()
  Set report = Application.LoadReport("[Relatório3]")
  Select Case _
    Application.SelectMenu("PDF|Excel|HTML|RTF|Texto|_
      TIFF|Texto(CSV)")
    Case 1
      Report.Export "PDF", "c:\correio\reports\report.pdf"
      MsgBox "Exportado para PDF!"
    Case 2
      Report.Export "EXCEL", "c:\correio\reports\report.xls"
      MsgBox "Exportado para XLS!"
    Case 3
      Report.Export "HTML", "c:\correio\reports\report.html"
      MsgBox "Exportado para HTML!"
    Case 4
      Report.Export "RTF", "c:\correio\reports\report.rtf"
      MsgBox "Exportado para RTF!"
    Case 5
      Report.Export "TEXT", "c:\correio\reports\report.txt"
      MsgBox "Exportado para Texto (CSV)!"
    Case 6
      Report.Export "TIFF", "c:\correio\reports\report.tiff"
      MsgBox "Exportado para TIFF!"
    Case 7
      Set reportFilter = report.GetExportFilter("TEXT")
      reportFilter.FileName="c:\correio\reports\_
        report2.txt"
      reportFilter.TextDelimiter = ","
      report.Export reportFilter
      MsgBox "Exportado para TXT usando filtro!"
  End Select
End Sub

Esta página foi útil?