![]() |
|
|
|
#1
|
||||
|
||||
|
It is simply a matter of moving the range as appropriate e.g.
Code:
Sub Macro1()
Dim Ff As FormField, Rng As Range
Dim MainTable As Table
Set MainTable = ActiveDocument.Tables(1)
Set Rng = MainTable.Cell(14, 1).Range
Rng.End = Rng.End - 1
Rng.Text = "This is some text "
Rng.Collapse 0
Set Ff = Rng.FormFields.Add(Rng, wdFieldFormCheckBox)
lbl_Exit:
Set Rng = Nothing
Set Ff = Nothing
Exit Sub
End Sub
Code:
Sub Macro2()
Dim CC As ContentControl, Rng As Range
Dim MainTable As Table
Set MainTable = ActiveDocument.Tables(1)
Set Rng = MainTable.Cell(14, 1).Range
Rng.End = Rng.End - 1
Rng.Text = "This is some text "
Rng.Collapse 0
Set CC = Rng.ContentControls.Add
With CC
.Type = wdContentControlCheckBox
.Tag = "Check1"
.Title = .Tag
.Checked = False
.LockContentControl = True
End With
lbl_Exit:
Set Rng = Nothing
Set CC = Nothing
Exit Sub
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
|
#2
|
|||
|
|||
|
thats it !!
Greetings from Berlin Andreas |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Pasting text from Excel cell into word without creating a table, and keeping the in-cell formatting | hanvyj | Excel Programming | 0 | 08-28-2015 01:15 AM |
Assigning values to formfield checkboxes in a table
|
mammiano | Word Tables | 13 | 01-12-2015 06:27 AM |
| How to copy userform text and formfield contents to outlook? | odin | Word VBA | 7 | 09-09-2014 11:56 AM |
| Auto-populate an MS Word table cell with text from a diff cell? | dreamrthts | Word Tables | 0 | 03-20-2009 01:49 PM |