Visio) (Application.ShowProgress 屬性

會決定在執行特定作業時是否顯示進度指標。 讀取/寫入。

語法

運算式ShowProgress

expression 代表 Application 物件的變數。

傳回值

整數

註解

如果您要執行通常會顯示進度指標的作業 (例如,列印),但不要顯示進度指標,可以將 ShowProgress 屬性設定為 False (0)。 ShowProgress 屬性預設為 True (非零)。

在大多數的情況下,您應該在完成作業時,將設定還原成先前的值。

範例

下列 Microsoft Visual Basic for Applications (VBA) 巨集會示範如何使用 Application 物件的 ShowProgress 屬性。 它會切換 (開/關) 進度指標的顯示,並在 [即時運算] 視窗中顯示屬性的狀態。

 
Sub ShowProgress_Example() 
 
 'Create a variable to hold the current state 
 'of the progress indicator. 
 Dim intProgress As Integer 
 
 'Display the current state of the progress indicator. 
 Debug.Print "Initial state: " & Application.ShowProgress 
 
 'Get the state of the progress indicator. 
 intProgress = Application.ShowProgress 
 
 'Turn off the progress indicator. 
 Application.ShowProgress = False 
 
 'Display the status again. 
 Debug.Print "Changed state: " & Application.ShowProgress 
 
 'Now restore the progress indicator to its original state. 
 Application.ShowProgress = intProgress 
 
 'Display the status again. 
 Debug.Print "Restored state: " & Application.ShowProgress 
 
End Sub

支援和意見反應

有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應