Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Word
application.errors
conversions
docmanagement
drawing.graphics
formatting.longdocs
international
internet.assistant
mail
mailmerge.fields
menustoolbars
newusers
numbering
oleinterop
pagelayout
printingfonts
setup.networking
spelling.grammar
tables
vba.addins
vba.beginners
vba.customization
vba.general
vba.userforms
web.authoring
word6-7macros
word97vba
  
 
date: 17 May 2005 14:36:18 -0400,    group: microsoft.public.word.word6-7macros        back       


One more question   
Now that I have got my paragraph and pasted it into my new document, I
would like to do it again with other names. I was thinking of a loop
or a do while loop. So I have created an array. 

TheNames= Array (joe, Harry, Ann)
--How do I get the count of TheNames

repeat with i from 1 to count of TheName--sorry for thr applescript
syntax
Find the name
-- Im not sure of the VBA syntax here
copy
paste into new doc
come back to original-
end repeat

Many Thanks again

-- 
Posted using the http://www.macforumz.com interface, at author's request
Articles individually checked for conformance to usenet standards
Topic URL: http://www.macforumz.com/Word-6-7-Macros-default-ftopict149841.html
Visit Topic URL to contact author (reg. req'd).  Report abuse: http://www.macforumz.com/eform.php?p=591298
date: 17 May 2005 14:36:18 -0400   author:   Sting2500

Re: One more question   
"Sting2500"  wrote in message 
news:2_591298_039df29d30b2c3c8c40c2aa7348985ed@macforumz.com...
> Now that I have got my paragraph and pasted it into my new document, I
> would like to do it again with other names. I was thinking of a loop
> or a do while loop. So I have created an array.
>
> TheNames= Array (joe, Harry, Ann)
> --How do I get the count of TheNames
>
> repeat with i from 1 to count of TheName--sorry for thr applescript
> syntax
> Find the name
> -- Im not sure of the VBA syntax here
> copy
> paste into new doc
> come back to original-
> end repeat

Dim TheNames As Variant
Dim i As Long
Dim myrange As Range

TheNames = Array("Joe", "Harry", "Ann")

For i = LBound(TheNames) To UBound(TheNames)
  'your code in here
  'use TheNames(i) for the search text

Next i


-- 
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
date: Wed, 18 May 2005 10:36:38 +0100   author:   Jonathan West

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us