Line spacing macro

D

dvbrook

I am attempting to add a button to a template that will allow users to
basically skip down a line from where there cursor is placed. Tnis will
allow inserting a new row for a table entry. The problem appears that since
there is not a reference statemend like "end" to go to the end of the
document, when the macro is initiated via a button, the cursor moves to the
area just under the buttons.

I have tried various statements to go to the end of the paragraph
(Selection.MoveEnd Unit:=wdParagraph), etc. in the macro, but nothing works I
have found.

The macro does work when it is activated by using the run command on the
tool bar, so I am confident it has something to do with the button click.

Interestingly, the other buttons for adding a new table and line item entry
to the table work fine, but those always default to the end of the document.
The base line space macro is as follows:

Private Sub LineSpc_Click()


Selection.MoveDown Unit:=wdLine, Count:=1
End Sub

Note that the base command: Selection.MoveDown Unit:=wdLine, Count:=1 works
when the macro is run from the toolbar and not the button.

Any suggestions would be helpful.

Thanks,

Don
 
D

Doug Robbins - Word MVP

Try and use the .Range object rather than the .Selection object. Also,
buttons belong on toolbars, not in documents IMHO.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

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