Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 12-28-2021, 02:01 PM
RMittelman RMittelman is offline Search & Replace using Document.Content Doesn't Include Footers Windows 10 Search & Replace using Document.Content Doesn't Include Footers Office 2016
Novice
Search & Replace using Document.Content Doesn't Include Footers
 
Join Date: Dec 2010
Posts: 19
RMittelman is on a distinguished road
Default

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.
Reply With Quote
 

Tags
regex, vba, word 16



Similar Threads
Thread Thread Starter Forum Replies Last Post
Search & Replace using Document.Content Doesn't Include Footers Help to include header and footer in string search code which i already have. branko Word VBA 1 03-28-2017 11:50 PM
Search & Replace using Document.Content Doesn't Include Footers 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

Other Forums: Access Forums

All times are GMT -7. The time now is 01:02 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