Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: Test BB Code Highlighting and Colors

  1. #11
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,457
    Rep Power
    10
    Test Burgandy

    Generic color name: Burgundy
    Colors that make up #8C001A
    RGB: 140, 0, 26 - HSL: 0.97, 1.00, 0.27

    Purple[COLOR="#800080"]Purple[/COLOR]
    Purple[COLOR=Purple]Purple[/COLOR]
    Maroon[COLOR="#800000"]Maroon[/COLOR]
    Maroon[COLOR=Maroon]Maroon[/COLOR]
    Burgundy[COLOR="#8C001A"]Burgundy[/COLOR]
    Windows10[color="#3E0000"]Windows10[/COLOR]
    color:#A82D00 $NFS




    HTML Code:
    <div class=WordSection1>
    
    <p class=MsoNormal><span lang=EN-GB style='font-size:9.0pt;line-height:115%;
    font-family:"Lucida Console";mso-bidi-font-family:"Lucida Console";color:#A82D00;
    mso-ansi-language:EN-GB;mso-fareast-language:DE'>$NFS</span><span lang=EN-GB
    style='font-size:9.0pt;line-height:115%;font-family:"Lucida Console";
    mso-bidi-font-family:"Lucida Console";mso-ansi-language:EN-GB;mso-fareast-language:
    DE'><span style='mso-spacerun:yes'>                             </span><span
    style='color:dimgray'>=</span> <span style='color:blue'>New-Object</span> <span
    class=SpellE><span style='color:blueviolet'>system.Windows.Forms.Button</span></span></span><span
    lang=EN-US style='mso-ansi-language:EN-US'><o:p></o:p></span></p>
    
    </div>
    Code:
    'Sub Makro9BBBurgundy()   '   '     https://excelfox.com/forum/showthread.php/2417-Test-BB-Code-Highlighting-and-Colors?p=16370#post16370
    '    With Selection
    '     .Font.Color = 1704076
    '     .Text = "[color=""#8C001A""] " & .Text & " [/color]"
    '     .Collapse Direction:=wdCollapseEnd
    '    End With
    'End Sub
    Sub Makro9BBBurgundy() '    Ctrl+Shift+B,G   '  https://eileenslounge.com/viewtopic.php?f=26&t=37808&p=292620#p292620
        Dim Text1 As String
        Dim Text2 As String
        Text1 = "[color=""#8C001A""] "
        Text2 = " [/color]"
        With Selection
            .InsertBefore Text:=Text1
            .InsertAfter Text:=Text2
            ActiveDocument.Range(Selection.Start, Selection.Start + Len(Text1)).Font.Size = 8
            ActiveDocument.Range(Selection.End - Len(Text2), Selection.End).Font.Size = 8
            .Font.Color = 1704076
            .Collapse Direction:=wdCollapseEnd
        End With
    End Sub
    Last edited by DocAElstein; 02-14-2022 at 04:51 PM.
    A Folk, A Forum, A Fuhrer ….

  2. #12
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,457
    Rep Power
    10

    Get rid of redundant BB Code tag pairs in MS Word text

    Test

    [COLOR=black][b]This will usually be black anyway[/b], not [color=orange]orange[/color], ([/COLOR] [color=purple]Purple[/color] [COLOR=black] is my favourite ) so I really don’t need the black color BB Code tag pairs [/COLOR]
    This will usually be black anyway, not orange, ( Purple is my favourite ) so I really don’t need the black color BB Code tag pairs


    [b]This will usually be black anyway[/b], not [color=orange]orange[/color], ( [color=purple]Purple[/color] is my favourite ) so I really don’t need the black color BB Code tag pairs
    This will usually be black anyway, not orange, ( Purple is my favourite ) so I really don’t need the black color BB Code tag pairs




    Trying to do that with wild stuff, makes my brain hurt a lot......
    Answer from Stuart at Eileen'sLounge: https://eileenslounge.com/viewtopic....299529#p299529
    https://i.postimg.cc/mDvfF9HP/Stuarts-In-German.jpg


    Code:
    Sub RemoveBlackBBCodeTagPairs() ' https://eileenslounge.com/viewtopic.php?p=299529#p299529
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
        With Selection.Find
         .Text = "\[COLOR=black\](*)\[/COLOR\]"
         .Replacement.Text = "\1"
         .Forward = True
         .Wrap = wdFindAsk
         .Format = False
         .MatchCase = False
         .MatchWholeWord = False
         .MatchKashida = False
         .MatchDiacritics = False
         .MatchAlefHamza = False
         .MatchControl = False
         .MatchAllWordForms = False
         .MatchSoundsLike = False
         .MatchWildcards = True
        End With
    Selection.Find.Execute Replace:=wdReplaceAll
    End Sub
    Hans simplified

    Code:
    ' https://eileenslounge.com/viewtopic....299537#p299537
    Sub RemoveBlackBBCodeTagPairs() '
        With Selection.Find
            .ClearFormatting
            .Replacement.ClearFormatting
            .Text = "\[COLOR=black\](*)\[/COLOR\]"
            .Replacement.Text = "\1"
            .MatchWildcards = True
            .Execute Replace:=wdReplaceAll
        End With
    End Sub
    Last edited by DocAElstein; 10-03-2022 at 03:31 PM.
    A Folk, A Forum, A Fuhrer ….

Similar Threads

  1. Replies: 12
    Last Post: 09-22-2023, 03:53 PM
  2. HTML Code Test --post8798
    By DocAElstein in forum Test Area
    Replies: 19
    Last Post: 06-17-2018, 03:02 PM
  3. test BB Code
    By DocAElstein in forum Test Area
    Replies: 39
    Last Post: 05-23-2018, 02:47 PM
  4. Replies: 5
    Last Post: 12-11-2015, 06:42 PM
  5. CODE TAG Code Test
    By DocAElstein in forum Test Area
    Replies: 5
    Last Post: 09-16-2015, 05:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •