Satbirdhil
New Member
- Joined
- Jul 1, 2021
- Messages
- 2
- Office Version
- 365
- 2016
- 2013
- 2011
- 2010
- 2007
- Platform
- Windows
MS 365 Apps for enterprise Version 2008 (Build 13127.21624). I can successfully add check boxes into a word table column in multiples rows with the code below.
However this is very slow. I thought it might be quicker to insert one checkbox, set its size to the size I want and then past it a multiple times into column '8' of the WdClothingform table in each subsequent row. The code successfully produces the result I want but it takes a very long time. The commented out code is one version of my many unsuccessful attempts at trying to copy that checkbox and then paste it.
i) How may I copy am ActiveX checkbox and paste it multiple times?
ii) Is there another faster way to produce the result I want.
For tblrow = 2 To WdClothingForm.RowS.count Step 1
WdClothingForm.Cell(tblrow, 8).Select
' Set chk = Wapp.Selection.InlineShapes.AddOLEControl(ClassType:="Forms.CheckBox.1")
'
' chk.Width = 11: chk.Height = 11
' Selection.copy
' chk.OLEFormat.Object.Activate
' Selection.copy
'
' WdClothingForm.Cell(3, 8).Select
' Selection.Paste
' chk.OLEFormat.Object.Paste
Set chk = Wapp.Selection.InlineShapes.AddOLEControl(ClassType:="Forms.CheckBox.1")
With chk.OLEFormat.Object
.Width = 11
.Height = 11
.Name = "ChkBx" & i - 1
End With
Next tblrow
Thank in advance for your help?
However this is very slow. I thought it might be quicker to insert one checkbox, set its size to the size I want and then past it a multiple times into column '8' of the WdClothingform table in each subsequent row. The code successfully produces the result I want but it takes a very long time. The commented out code is one version of my many unsuccessful attempts at trying to copy that checkbox and then paste it.
i) How may I copy am ActiveX checkbox and paste it multiple times?
ii) Is there another faster way to produce the result I want.
For tblrow = 2 To WdClothingForm.RowS.count Step 1
WdClothingForm.Cell(tblrow, 8).Select
' Set chk = Wapp.Selection.InlineShapes.AddOLEControl(ClassType:="Forms.CheckBox.1")
'
' chk.Width = 11: chk.Height = 11
' Selection.copy
' chk.OLEFormat.Object.Activate
' Selection.copy
'
' WdClothingForm.Cell(3, 8).Select
' Selection.Paste
' chk.OLEFormat.Object.Paste
Set chk = Wapp.Selection.InlineShapes.AddOLEControl(ClassType:="Forms.CheckBox.1")
With chk.OLEFormat.Object
.Width = 11
.Height = 11
.Name = "ChkBx" & i - 1
End With
Next tblrow
Thank in advance for your help?