Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Other Office > Word VBA
|
Word VBA Discuss using VBA to program Word.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Word VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 28th, 2006, 11:52 PM
SMI SMI is offline
Authorized User
 
Join Date: Jul 2006
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default Why no one is helping?????? This is my 3rd request

Dear friends
I have posted a very simple question regarding LOOP in word, that is how o loop through all the lines in a word documents where each line has one word only (basically this is a list of words).

This is my third request with a hope that someone will help.

Genius is 99% perspiration and 1% inspiration
__________________
Genius is 99% perspiration and 1% inspiration
 
Old September 29th, 2006, 03:59 AM
Authorized User
 
Join Date: Sep 2006
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Calm down!!
I'm not 100% sure of the purpose of this code but if as you suggested you have one word per line (with a carriage return after) you can use the following code to loop through from the first line through to the last:

Sub LoopParagraphs()

For Each Paragraph In ActiveDocument.Paragraphs
    Paragraph.Range.Select 'select the paragraph (or in this case line)
        'do something with the selection
Next

End Sub


Hope this helps!
Thanks






Similar Threads
Thread Thread Starter Forum Replies Last Post
request forwarging & request redirection hafizmuhammadmushtaq Servlets 2 April 24th, 2008 12:42 AM
Request.Form / Request.QueryString Toran Classic ASP Databases 4 January 17th, 2007 02:23 PM
helping starters pokiri SQL Server 2000 1 August 31st, 2006 05:03 AM
request.qurystring vs. request.form Durwood Edwards Classic ASP Databases 3 June 18th, 2004 12:09 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.