That is exactly what the code that I gave you will do.
Try
MsgBox Selection.Bookmarks("\line").Range.Text
If the cursor is in a line that contains the text "Hello This is line 9" a
message box will be displayed that contains:
"Hello This is line 9"
--
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
Not sure what you are really after, but
Selection.Bookmarks("\line").Range.Text
will return the text of the line in which the selection is located.
--
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
How to get current line value ? Using 2003 coding.
Before using
WordBasic.StartOfLine
WordBasic.LineDown 1, 1 'Select current line
inputLine$ = UCase(WordBasic.[Selection$]())
moonhkt- ÁôÂóQ¤Þ¥Î¤å¦r -
- Åã¥Ü³Q¤Þ¥Î¤å¦r -
Thank. But the soluation is not.
e.g. If the cursor at line 9 , the text in line 9 "Hello This is line
9". I want return "Hello This is line 9" string.
In Word Basic , the coding as below. Now, I want VBA coding.
WordBasic.StartOfLine
WordBasic.LineDown 1, 1 'Select current line
inputLine$ = UCase(WordBasic.[Selection$]())