Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
How do I find word #547 from the beg of a word doc?
I want to be able to select words at random based on their depth from the
beginning of the document. |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
How do I find word #547 from the beg of a word doc?
Hi ?B?ZHdhbHRocnM=?=,
I want to be able to select words at random based on their depth from the beginning of the document. Well, keeping in mind that Word may interpert what a "Word" is differently than you, a macro like this could help: Sub GoToWordN() Dim doc As Word.Document Dim lNumWords As Long Dim lTarget As Long Dim sTarget As String Set doc = ActiveDocument lNumWords = doc.Words.Count sTarget = InputBox( _ "Enter the word-index to which you want to go:") If IsNumeric(sTarget) Then lTarget = CLng(sTarget) If lTarget 0 And lTarget = lNumWords Then doc.Words(lTarget).Select Else MsgBox "Invalid word-index. The document contains " _ & lNumWords & " words.", vbOKOnly + vbInformation End If End If End Sub Cindy Meister INTER-Solutions, Switzerland http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004) http://www.word.mvps.org This reply is posted in the Newsgroup; please post any follow question or reply in the newsgroup and not by e-mail :-) |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Word 97 in Windows XP to maintain formatting | Microsoft Word Help | |||
Converting WordPerfect 12 files to Word 2003 | New Users | |||
Compare Word to Wordperfect? | Microsoft Word Help | |||
Word should allow to 'divide' page by 3 or 4, not just 2 | Page Layout | |||
In Word, how can I see all files (*.*) in "save as"? | New Users |