in Word VBA, find the current position in a table, then do a merge of the whole line and write Text in it

Ivo Raemy
Ivo Raemy used Ask the Experts™
on
Dear Sir, Dear Madam

In Word VBA, I would like

1. to find the current position in a table
2. then do a merge of the whole table line
3. write Text in it

Is there a way to do this?

Sincerely

Ivo Raemy
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
From memory:

Selection.Range.Rows (1).Cells.Merge
Selection.Range.Text = "Your Text Here"

Commented:
Selection always gives you the position of the cursor, I hope that is what you wanted 😊
Ivo RaemyAnalyst Programmer

Author

Commented:
Great, it works

Commented:
No worries, you can also use (again, from memory) selection.range.information to find out if you are in a table and avoid any error if you are not in a table

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial