使用 VBA 通过按钮打印趋势图表
使用 VBA 通过按钮打印趋势图表。
要使用 VBA 通过按钮打印趋势图表:
- 向图形画面中添加一个按钮,然后单击确定。
- 右键单击趋势对象,然后选择VBA 代码。
- 返回至FactoryTalk View Studio,右键单击按钮对象,然后选择VBA 代码。
- 在按钮释放事件代码区域中键入趋势对象的名称。Private Sub Button1_Released()Trend1End Sub
- 按下句点键,然后选择PrintChart。Trend1.PrintChart
- 按下空格键,然后为 UsePortraitMode 参数选择True或False。Private Sub Button1_Released()Trend1.PrintChart TrueEnd Sub
- 按下逗号键,然后为 ShowPrinterSelection 参数选择True或False。Private Sub Button1_Released()Trend1.PrintChart True, FalseEnd Sub
- 测试画面。
提供反馈