- Word link to previous header not working code#
- Word link to previous header not working professional#
I hope my explanation is now clear enough.
![word link to previous header not working word link to previous header not working](https://venturebeat.com/wp-content/uploads/2020/01/Profile.png)
So it is really great, but not perfect in my case, since it may fall in a time-consuming approach, which I want to avoid. I assume that using the line "for each oHF in oSection.Headers" goes indeed into each header, whatever it is, and whatever its state is. say 100 different headers and 400 "linked headers"), going through each header would be time-consuming, while skipping those linked headers would help processing the algorithm faster. Consider the fact that if a 500 pages document has 100 different sections (i.e. though your "if" line can go fast indeed, I do have a concern with processing speed, since the documents that are used with the macro can have any number of pages/sections (from 1 to 1000's of pages), in which case I want to avoid searching those sections that are linked, since the strings have already been searched for in the parent sections. That doesn't work in my case as I need to preserve everything but the strings I am looking for. using the whole header range is very interesting, but replacing it actually overwrites the whole header, including any text box. inStr is a great function indeed that I could make use of in other cases (and I certainly will), but is there a way to keep track of the number of replacements your algorithm is doing, as I need to keep track of it? Now, I do love your approach, but I have a few questions/concerns with it: The tags are sent to the function through a string, a bit like you did with strCheck (though I found it funny that you actually don't use it in your example, but I got your point). # and #), in which case I only make sure I have an even number of tags within the header, to avoid processing the wrong text. #), but they can also be the same ones (e.g. if 2 opening tags are found consecutively with no closing tag in-between, they are ignored), the text is processed through another function (let's say it is highlighted and tags are deleted).Īs a side note, those tags have a minimum of 2 characters each (e.g. I have to find 2 sets of strings, a bit like brackets (opening tag, closing tag) and if everything seems fine (those tags are found in the correct order, i.e. I can only say that they are actually tags that surround text. I don't actually know what they are, since they can be different every time. The strings I search for are given by the user. I don't always get the whole point, and though I know where I am heading, I don't always understand what the best path is. I appreciate so much your help! Thanks also for pushing me. However, maybe you DO need it, it is impossible to tell without knowing what exactly is supposed to happen.
Word link to previous header not working code#
Note that the code does not test for Link to Previous, because for what it does, that is not needed.
![word link to previous header not working word link to previous header not working](https://venturebeat.com/wp-content/uploads/2018/10/Fit-Content-Proportionally.png)
However, a basis for any code is to define - exactly - what it is that is supposed to happen.
Word link to previous header not working professional#
BTW, I am not a professional programmer either.
![word link to previous header not working word link to previous header not working](http://www.addbalance.com/usersguide/images/2013SectionBreakOddEven.png)
But again, what - exactly - is supposed to happen.
![word link to previous header not working word link to previous header not working](https://i.ytimg.com/vi/qJLPiIfxLeE/maxresdefault.jpg)
Replace(, "old stuff", "new and improved stuff")Įnd Sub The above goes through ALL headers and if the string "old stuff" is there, it is replaced with "new and improved stuff". Where are you getting those strings? Are you selecting some text elsewhere in the document and then using THAT to search for? Is the string from a different document? Is there going to be more than one string to search for?įor Each oSection In ActiveDocument.Sections For example, you state you want to find specific strings. How can I put this? Please state - exactly - what it is you want to happen.