![]() |
|
#5
|
|||
|
|||
|
Hi GMayor,
I'm playing with your code, and I'm confused by something. The code loops through the story ranges, only processing types 1 - 11. That I understand. If the story type is 6 - 11 (headers & footers), it process them again if they have a shape range count >0. Also, they only process if they have a TextFrame with .HasText true. I presume these are text boxes in the headers/footers, and you want to replace text in those text boxes. So this brings up 2 questions: 1: What if there are text boxes NOT in a header or footer? This seems to ignore that possibility. 2: The code sends the oStory object to the subroutine, but that was already done before, right? If you want to replace text in the text box(es), shouldn't you be sending the text box range to the subroutine instead of the oStory range, which has already been processed? If this is so, what object should you send the second time? I can't seem to find a text range object in the Word object model under StoryRanges or ShapeRange.TextFrame. Do you have any ideas on this? Please forgive if my understanding of your code is faulty. Thanks... P.S. I've been using a simplified version which loops through each StoryRange and does the find and replace without worrying about shapes. Seems to work fine, but I'm curious about your code. |
| Tags |
| regex, vba, word 16 |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Help to include header and footer in string search code which i already have.
|
branko | Word VBA | 1 | 03-28-2017 11:50 PM |
Need some vba code to search a word document an replace it if len = 3
|
Belleke | Word VBA | 3 | 10-24-2016 01:00 AM |
| Table of content to not include TOC as first section!? | neuroscientist911 | Word | 4 | 11-19-2014 07:55 AM |
| Windows Search Does Not Include Outlook | jkingston | Outlook | 0 | 07-20-2014 08:43 AM |
| Looking for Windows Search app with ability to search by content | gopher_everett | Office | 1 | 02-28-2013 09:23 PM |