Dim i As Integer, rule As rtHRule
call ctxDump.getRichTextItem(doc,"Body")
Set hotcoll = ctxDump.Collection(PARSE_GROUP_GRAPHIC)
Dim enum As New rtEnumeration(hotcoll), o
Do While enum.hasMoreElements
 Set o = enum.nextelement
 o.RuleHeight= Cint(8000*Rnd) Mod 5*ONE_CM ' set it random height (up to 5 cm) and random (gradient) color
 o.Color.setAltRGB Cint(10000*Rnd) Mod 255,Cint(10000*Rnd) Mod 255,Cint(10000*Rnd) Mod 255
Loop
' let's create 10 random size random color rulers!
For i=0 To 10
 Set rule = New rtHRule(Cint(10000*Rnd) Mod 5*ONE_CM)
 Set rule.Color = New rtColor(0)
 rule.fitToWindow=True
 rule.hasGradient = True
 rule.Color.setAltRGB Cint(10000*Rnd) Mod 255,Cint(10000*Rnd) Mod 255,Cint(10000*Rnd) Mod 255
 rule.Color.setRGB Cint(10000*Rnd) Mod 255,Cint(10000*Rnd) Mod 255,Cint(10000*Rnd) Mod 255
 rule.RuleWidth=Cint(10000*Rnd) Mod 60
 ctxDump.add rule
Next
|