範例一:
CreateObject 是指一般函式
CreateObject(引用項目)

例如:
Set FO = CreateObject("Scripting.FileSystemObject")
Set OpenFile = FO.OpenTextFile(TextBox1.Value) 
Set SaveFile = FO.CreateTextFile(TextBox2.Value, True)
引用項目為 Scripting,也可用 Scripting 物件類別 (Class) FileSystemObject
Scripting 物件類別呼叫 FileSystemObject 程序 (Function):OpenTextFile

範例二:
在 Microsoft Visual Basic中,引用項目:Microsoft Scripting Runtime 的物件
位置是:C:\windows\system32\scrrun.dll
之後 drag mouse [檢視]→[瀏覽物件],物件原本沒有之前出現過;可是引用項目 Microsoft Scripting Runtime 的物件後,隨之也會顯示在 Scripting 物件類別:例如 File 類別 (Class) / Files 類別 (Class) / FileSystemObject 類別 (Class) /...

程式碼中使用加上這一行:
Dim myTS As TextStream
Set myTS.
也會出現逗點後,顯示出 TextStream 類別 (Class) 的成員:AtEndOfLine (Property) / AtEndOfStream (Property) / Close 副程式 (Sub) /...

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 Axxxx 的頭像
    Axxxx

    Axxxx

    Axxxx 發表在 痞客邦 留言(0) 人氣()