Content select question?

O

OKLover

Dear All,

I wonder if any property or method could to check the current document
content is selected all or not?



Many thanks

David
 
G

Graham Mayor

If you mean all as in the context of using CTRL+A then

If Selection.Range.Start = ActiveDocument.Range.Start And _
Selection.Range.End = ActiveDocument.Range.End Then
MsgBox "The document is selected"
Else
MsgBox "Only part of the document is selected"
End If

would do that, but it would be better to assign a range rather than a
selection and then you would not need to make the test.
Set oRng = ActiveDocument.Range

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
O

OKLover

Thanks! Graham Mayor. :D




Graham Mayor said:
If you mean all as in the context of using CTRL+A then

If Selection.Range.Start = ActiveDocument.Range.Start And _
Selection.Range.End = ActiveDocument.Range.End Then
MsgBox "The document is selected"
Else
MsgBox "Only part of the document is selected"
End If

would do that, but it would be better to assign a range rather than a
selection and then you would not need to make the test.
Set oRng = ActiveDocument.Range

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>





.
 
G

Graham Mayor

You are welcome :)

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - 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