moveup wdline=1 moves 3 lines not 1 line MS Word 2000?

A

Al

BACKGROUND:

I use MS Office 2000. In an MS Word document, I have a table that is 5
columns wide, and 8 rows long. There are 3 header lines, and 5 detail lines.


I load the detail lines from an MS Access Database and MS Access VBA program
which works fine.

The entire outer table gridlines are highlighted so it looks like a table
with a box around it.

When access loads the table the last line is blank (which contains the
original formatting). This line is deleted. I move the cursor up a line and
then the last line in the table is selected and the formatting added back.
Below is the program.

Set appword = GetObject(, "Word.Application")

'FORMAT LAST ROW IN TABLE & BOTTOM TABLE LINE
1. appword.Selection.Rows.Delete
2. appword.Selection.MoveUp Unit:=wdLine, Count:=1
3. appword.Selection.SelectRow
4. With Selection.Cells
5. With .Borders(wdBorderBottom)
6. .LineStyle = wdLineStyleSingle
7. .LineWidth = wdLineWidth050pt
8. End With
9. End With

My problem that line 2 of the program moves the cursor up three lines
instead of just one.

If I have MS Word open at the time I run the Access VBA code it only moves 1
line as expected.

QUESTION:
How can I control the cursor to move up only one line instead of 3 lines?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top