2013-02-04 181 views

回答

3

試試這個:

Dim mulpage as Control, pge as Page, counter as Integer 
For Each mulPage In Me.Controls 
     If TypeName(mulPage) = "MultiPage" Then 
      For Each pge In mulPage.Pages 
       counter = counter + 1 
      Next pge 
     End If 
Next 

My code is in 2003. So for you, you need to reference the Form Page property explicitly using Dim pge As msforms.Page instead of Dim pge As Page for 2007, 2010...going forward.

參考文獻:

+0

不應該是'如果TypeName(mulPage)=「MultiPage」'? –

+0

我遵循你的回答和參考資料,但它對我無效。 「somename」是什麼意思,多頁面的名稱? – blackmail

+0

抱歉,您必須使用@Doug指出的內容。它必須是類型名稱'MultiPage'我把它與控件的'Name'混合起來。 – bonCodigo