Print a trend chart from a button using VBA

Print a trend chart from a button using VBA.
To print a trend chart from a button using VBA:
  1. Add a button to a graphic display, and then click
    OK
    .
  2. Right-click the trend object and then select
    VBA code
    .
  3. Return to
    FactoryTalk View Studio
    , right-click the button object and then select
    VBA code
    .
  4. Type the name of the Trend object in the button released event code area.
    Private Sub Button1_Released()
    Trend1
    End Sub
  5. Press the period key and then select
    PrintChart
    .
    Trend1.PrintChart
  6. Press the space key and then select
    True
    , or
    False
    for the UsePortraitMode parameter.
    Private Sub Button1_Released()
    Trend1.PrintChart True
    End Sub
  7. Press the comma key and then select
    True
    , or
    False
    for the ShowPrinterSelection parameter.
    Private Sub Button1_Released()
    Trend1.PrintChart True, False
    End Sub
  8. Test the display.
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal