B
bhartman33
Hi, Everyone.
I'm having an odd problem with Word 2000. Every time I run through
this loop step-by-step (in debug mode), it runs perfectly, but when I
try to execute it, it gets hung up. Here is the loop I'm trying to do:
For Each Row In Selection.Tables(1).Rows
Selection.StartOf unit:=wdParagraph, Extend:=wdMove
Selection.MoveDown unit:=wdParagraph, count:=1, Extend:=wdExtend
Selection.Font.Bold = wdToggle
Selection.MoveRight unit:=wdCharacter, count:=1, Extend:=wdExtend
Selection.Cells.Merge
Selection.MoveDown unit:=wdLine, count:=1
Next Row
Basically, it's just supposed to bold the contents of the cell in the
first column, merge that with the contents of the cell in the next
column, then move down to the next row. Like I said, when I run
through my table step-by-step, I've got no problems, but when I try to
let the macro run on its own, it fails. (Specifically, it doesn't
select all the text in the first column, and doesn't select the second
column, so that the merge fails.
Can anyone give me some advice (or show me a better way to do this)?
Thanks.
I'm having an odd problem with Word 2000. Every time I run through
this loop step-by-step (in debug mode), it runs perfectly, but when I
try to execute it, it gets hung up. Here is the loop I'm trying to do:
For Each Row In Selection.Tables(1).Rows
Selection.StartOf unit:=wdParagraph, Extend:=wdMove
Selection.MoveDown unit:=wdParagraph, count:=1, Extend:=wdExtend
Selection.Font.Bold = wdToggle
Selection.MoveRight unit:=wdCharacter, count:=1, Extend:=wdExtend
Selection.Cells.Merge
Selection.MoveDown unit:=wdLine, count:=1
Next Row
Basically, it's just supposed to bold the contents of the cell in the
first column, merge that with the contents of the cell in the next
column, then move down to the next row. Like I said, when I run
through my table step-by-step, I've got no problems, but when I try to
let the macro run on its own, it fails. (Specifically, it doesn't
select all the text in the first column, and doesn't select the second
column, so that the merge fails.
Can anyone give me some advice (or show me a better way to do this)?
Thanks.