S
Steve Cronin
Folks;
What I want to do is essentially 'mail-merge' but the user is not going
to be placing merge tags.
They will simply put placeholders that I will substitute with data in
my script.
They will be placing the text in normal layout, inside of textboxes,
and inside of tables.
Could be some or all of the above.
How do I determine if there are any TEXT BOXES and then iterate over
them changing .Text any 'abc' to 'xyz'? (TextBoxes just puzzle me...)
For Tables I've figured out that I can do:
With ActiveDocument.Tables(1)
For i = 2 To .Rows.Count
For j = 1 To .Columns.Count
[do something with .Cell(i,j).Range.Text]
Next j
Next i
End With
But:
1) How do I determine how many tables there are and then iterate over
them successively?
2) Is there a smarter way than walking every thru cell and checking for
..Range.Text?
In the general layout (not in a TextBox or a Table) is this the
preferred solution:
With Selection.Find.Text ="abc"
..Replacement.Text = "xyz""
..Forward = True
..Wrap = 1
..Format = False
End With
ReplaceAll()
Thanks for any insight!!
Steve
What I want to do is essentially 'mail-merge' but the user is not going
to be placing merge tags.
They will simply put placeholders that I will substitute with data in
my script.
They will be placing the text in normal layout, inside of textboxes,
and inside of tables.
Could be some or all of the above.
How do I determine if there are any TEXT BOXES and then iterate over
them changing .Text any 'abc' to 'xyz'? (TextBoxes just puzzle me...)
For Tables I've figured out that I can do:
With ActiveDocument.Tables(1)
For i = 2 To .Rows.Count
For j = 1 To .Columns.Count
[do something with .Cell(i,j).Range.Text]
Next j
Next i
End With
But:
1) How do I determine how many tables there are and then iterate over
them successively?
2) Is there a smarter way than walking every thru cell and checking for
..Range.Text?
In the general layout (not in a TextBox or a Table) is this the
preferred solution:
With Selection.Find.Text ="abc"
..Replacement.Text = "xyz""
..Forward = True
..Wrap = 1
..Format = False
End With
ReplaceAll()
Thanks for any insight!!
Steve