Full Code "Belt and Braces" in Word Find Replace & String Manipulation of initial Text String in Clipboard


This code is simply doing the two ways to remove BB Code code tag pairs from a copied to the clipboard Text from a Word document.
A check is then done Finally to see if the two raped from tags strings are the same.

I would not be surprised if a fail in the strings match just means that the second method, ( my long string manipulation way ) is getting it wrong.. Lol.. but never mind ***
***Edit:
- like I just did: It will not work for nested BBCode code tags like
[CENTER][B]Issue Forum for Issues suggestions for improvement Forum for Issues obfuscation[/B][/CENTER]
This is OK
[B]Issue Forum for Issues suggestions for improvement Forum for Issues obfuscation[/B]


That will do for this one, I guess I will have to do a recursion wonk to get a version working with nested BB Code Tag code tags,
_.____________-

Ok. Here we go:
This code _..
Sub BBCodeCodeTagsWegDaMit2AlanHansPaul2()
_.. is mostly just splicing together codes
Sub WegDaMitHansPaulAlan()
and
Sub LongWayOfDoingIt()
along with adding a short section, Rem 10a) to check that the strings are the same. That is to say the
Full Story selection text from the modified ( removed BB Code code tags ), NewWordText for Code Part 1)
is
compared with the final RapedText from the long string manipulation Code part 2)

The code is all one code and broken down into this and the next three posts

Code part 1 of 4 parts ( all following parts to be copied directly under the preceding part in the same code module.
Code:
Sub BBCodeCodeTagsWegDaMit2AlanHansPaul2() ' http://www.excelforum.com/development-testing-forum/1086445-forum-tools-test-no-reply-needed-4.html#post4586680
' === Code assumes you have a Word File open, and have selected some Text
' One way is automating doing it in Word.    "Wild Things. You make my heart sing. They make everything….. Groovy"       '_-   http://www.eileenslounge.com/viewtopic.php?f=26&t=26030#p202322
Rem 0) ' Just mucking about a bit with refering to Word documents
' Documents.Item("eileenslounge.docm").Activate
'Dim DocNme As String               ' ' Prepares "Pointer" to a "Blue Print" (or Form, Questionaire not yet filled in, a template etc.)"Pigeon Hole" in Memory, sufficient in construction to house a piece of Paper with code text giving the relevant information for the particular Variable Type. VBA is sent to it when it passes it. In a Routine it may be given a particular "Value", or ("Values" for Objects).  There instructions say then how to do that and handle(store) that(those). At Dim the created Paper is like a Blue Print that has some empty spaces not yet filled in. A String is a a bit tricky. The Blue Print code line Paper in the Pigeon Hole will allow to note the string Length and an Initial start memory Location. This Location well have to change frequently as strings of different length are assigned. Instructiions will tell how to do this. Theoretically a specilal value vbNullString is set to aid in quich checks.. But..http://www.mrexcel.com/forum/excel-questions/361246-vbnullstring-2.html#post44116
' Let DocNme = ActiveDocument.Name  ' ' '_-So A variable in VBA is like the Link to the part of a URL string reducing size site where a few things about the actual Final site is informed about. This area in that site, like a pigion Hole to which the variable refers, ( the "pigeon hole" location address, and all its contents would be defined as the "Pointer". Amongst other things it has a link, a "Pointing part", pointing to actually where all the stuff is
Dim Doc As Document 'A variable in VBA is like the Link to the part of a URL string reducing size site where a few things about the actual Final site is informed about. This area in that site, like a pigion Hole to which the variable refers, ( the "pigeon hole" location address, and all its contents would be defined as the "Pointer". Amongst other things it has a link, a "Pointing part", pointing to actually where all the stuff is
 Set Doc = ActiveDocument  'EP Set: Fill or partially Fill: Setting to a Class will involve the use of an extra New at this code line. I will then have an Object referred to as an instance of a Class. At this point I include information on my Pointer Pigeon hole for a distinct distinguishable usage of an Object of the Class. For the case of something such as a Workbook this instancing has already been done, and in addition some values are filled in specific memory locations which are also held as part of the information in the Pigeon Hole Pointer. We will have a different Pointer for each instance. In most excel versions we already have a few instances of Worksheets. Such instances Objects can be further used., - For this a Dim to the class will be necessary, but the New must be omitted at Set. I can assign as many variables that I wish to the same existing instance
Rem Code Part 1) make two temporary Word Files with and without BB Code