![]() |
|
#1
|
|||
|
|||
![]()
For some reason, I need a vba code (word 2013) that
1) Moves first to the first paragraph 2) Selects the text in that paragraph 3) Do an event. Afterwards, it should move to the next paragraph .....etc. till the last paragraph. I've tried this code: Dim wdoc As Document Dim Para As Paragraph Set wdoc = ActiveDocument For Each Para In wdoc.Paragraphs do..... Next Para But it doesn't move to the next paragraph. Thanks in advance |
#2
|
||||
|
||||
![]()
The logic is OK if your 'event' doesn't remove the Para. However it sounds like you are doing exactly that. Normally, we get around this by working backwards through a collection.
See this thread for an approach that might work better https://www.msofficeforums.com/word-...paragraph.html
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
laith93 | Word VBA | 6 | 10-14-2022 11:10 PM |
![]() |
Cendrinne | Word VBA | 9 | 06-11-2021 09:39 PM |
![]() |
mrsjetset | Word VBA | 1 | 06-26-2016 07:41 AM |
Find Bookmark, move to bookmark, execute code, repeat | raymm3852 | Word VBA | 10 | 04-15-2016 06:21 PM |
![]() |
marceepoo | Word VBA | 2 | 12-20-2012 11:42 AM |