macros and parameters

L

Laurie

Hi,
I want to use a macro to respond to any of several
checkboxes and either dim the line containing the calling
checkbox or darken the line - depending on whether the
checkbox is false or true.
How do I 'tell the macro' which checkbox called it? Or
perhaps better, which line on the page the cursor was on
at the time?

Thanks, Laurie
 
J

Jonathan

-----Original Message-----
Hi,
I want to use a macro to respond to any of several
checkboxes and either dim the line containing the calling
checkbox or darken the line - depending on whether the
checkbox is false or true.
How do I 'tell the macro' which checkbox called it? Or
perhaps better, which line on the page the cursor was on
at the time?

Thanks, Laurie

.
Hi Laurie,

you can 'tell' the line using the following example:

Dim rng As Word.Range
Dim lngLine As Long

With ActiveDocument
rng = .Range(.Bookmarks("\Page").Start, _
.Bookmarks("\Line").End)
lngLine = rng.ComputeStatistics(wdStatisticLines)
End With

MsgBox lngLine

Luck
Jonathan
 

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