Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Word - Test whether a word(s) was selected in a doc

Status
Not open for further replies.

orman

IS-IT--Management
Jun 14, 2001
123
US
Need to test to see whether a user selects a word(s)in a document. My try is this:

If selection.words.count =0 then
MsgBox "No text was selected. Try again."
Else...

But this doesn't work. Anyone know how I can test this?

(Xtra Info: The macro I'm working on needs to copy the selected text on to the clipboard, then to to a second open document, and insert a footnote, pasting the copied text into the footnote.)
 
if Selection.Start = Selection.End then
msgbox "no text selected", vbexclamation
else
msgbox "with selected text", vbinformation
end if
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top