Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm looking for a code to create x (5,10.....)numbers of Textboxes.
With the ability to change parameters (Width and Hight)
The code works for me. I have attached a qvw.
Maybe this will get you started:
sub test
for i = 1 to 20
set mytext = ActiveDocument.ActiveSheet.CreateTextObject
strObjID = mytext.GetObjectID
set fr = mytext.GetFrameDef
pos = fr.Rect
pos.Top = i*60
pos.Left = i*60
pos.Width = 60
pos.Height = 90
mytext.SetFrameDef fr
' strBkgColor = BkgColor(strEventType)
' strBkgColor = "200,200,200"
BGColorArray = Split(strBkgColor, ",", -1, 1)
set prop = mytext.GetProperties
prop.Layout.Text.v = strObjID
' prop.Layout.Frame.HelpText.v =strNewObjectID
prop.Layout.BkgAlpha = 255 'Transparency 0%
' prop.Layout.BkgColor.PrimaryCol.Col = RGB(CInt(BGColorArray(0)),CInt(BGColorArray(1)),CInt(BGColorArray(2)))
prop.Layout.TextColor.PrimaryCol.Col = RGB(0,0,0)
prop.Layout.Frame.ZedLevel = 1
prop.Layout.Frame.Show.Always = true
prop.Layout.Frame.Show.Expression.v = 0
prop.Layout.BottomMargin = 0
prop.Layout.TopMargin = 0
prop.Layout.LeftMargin = 0
prop.Layout.RightMargin = 0
mytext.SetProperties prop
next
end sub
Thanks.
I'm getting error:
'Expected statement'
The code works for me. I have attached a qvw.
Thank you m w.
Silly mistake from my side:
Forgot the first sub line...