Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 04-27-2015, 06:26 PM
Guessed's Avatar
Guessed Guessed is offline How to select the text of certain length? Windows 7 32bit How to select the text of certain length? Office 2010 32bit
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,185
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Microsoft's definition of what is a 'word' apparently includes punctuation but this might get you started
Code:
Sub ExpandWords()
  Dim x As Integer
  x = InputBox("How many words?", "Counter", 10)
  If x > 0 Then
    Selection.MoveRight Unit:=wdWord, Count:=x, Extend:=True
  End If
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA Search Table for Text/Select Text/Insert Hyperlink sldrellich Word VBA 3 03-24-2015 01:09 PM
Microsoft Word macro to find text, select all text between brackets, and delete helal1990 Word VBA 4 02-05-2015 03:52 PM
How to select the text of certain length? Select section of text and change text newbieX Word VBA 3 03-28-2014 04:21 PM
Limit text length Content Control NobodysPerfect Word 10 02-28-2014 02:40 PM
How to select the text of certain length? Import from variable length text diouna Excel 3 07-10-2012 09:43 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:01 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft