dim o for each o in controls debug.print typename(o) next
典型的倒分贴! 5楼正解! If TypeOf 可以判断传入过程的控件是否为一文本框。
Sub ControlProcessor(MyControl As Control) If TypeOf MyControl Is CommandButton Then Debug.Print "You passed in a " & TypeName(MyControl) ElseIf TypeOf MyControl Is CheckBox Then Debug.Print "You passed in a " & TypeName(MyControl) ElseIf TypeOf MyControl Is TextBox Then Debug.Print "You passed in a " & TypeName(MyControl) End If End Sub
请教一下:我用vb写了一个调用Illustrator的测试程序,代码很简单:Private Sub Command1_Click() Dim app As New Illustrator.Application Dim doc As Illustrator.Document Dim thislayer As Illustrator.Layer ......
function multi(a as integer,b as integer,optional third) dim n as integer n = a * b if not ismissing (third) then n = n * thid end if multi = n end fu ......