Word Excel , . , , . , . , , Word , , Excel. , .. (General, ). , .
.
, Sheet1, :
Public maxcena as Integer
:
ActiveWorkbook.Sheet1.maxcena=56
, ! WORD-, , , - . - , "" , Word Variables. , .
.
:
ThisDocument.Variables.Add "nn", "567"
, , , :
MsgBox ActiveDocument.Variables("nn")
:
MsgBox ActiveDocument.Variables(1)
. , , , .. . , . . , , , .
, , , . ADD, REMOVE.
, , , . . . , New. , New. .
VBA ActiveX . VB ( , Office) . ActiveX - , .
|
|
VBA (Collection). . , Item, . , . .
. , , . , , , .. .
.Item. FOR EACH ( . ).
, , , . , . . .
Sub test1()
Dim cl As New Collection
x1 = 12
yy = "eeeeeeeee"
cl.Add x1
cl.Add yy
For Each c In cl
MsgBox c
Next
yy = "qqqq"
For Each c In cl
MsgBox c
Next
: , (Remove) (Add). , . , , , , , ().
8 | 24 (16) | aaa | (*) | ||||||
cl | cl(1) | ob2 | cl(2) | ob1 | obj |
7
7 cl, cl(1), cl(2). ( ) ob1. ob2. , . , , , . obj, ob2. , obj1 , obj2 . .