Quote:
then you'd do better to use something like:
Code:
.Text = "\[color=0040FF\](*)\[/color\]"
.Replacement.Font.Color = &H40FF
|
I can't get the visual basic to accept &H40FF or any combination I have tried?
I put the numbers in back to front i.e. &H40FF becomes &HFF0400 and it works? I now get blue
If you scroll down
https://htmlcolorcodes.com/ about the middle you get
# XX XX XX
by putting them into my macro back to front the colours show up.
It deletes the leading '0's so I am going to keep playing and see what I find.
It accepts &HFF for red (i.e. 0000FF with the leading 0s' removed)
It accepts &HFF0000 for blue
but it won't accept &HFF00 for green (even if I put &H00FF00)
It accepts &H04FF00 for a paler green? (that it changes to &H4FF00) and &H01FF00 (that it changes to &H1FF00)
&H018000 is a better green. changed to &H18000.
I am also looking at size
I opened up your program so the different instructions are in blocks of 4 like this
.Replacement.ClearFormatting
.Text = "\[b\](*)\[/b\]"
.Replacement.Font.Bold = True
.Execute Replace:=wdReplaceAll
.Replacement.ClearFormatting
.Text = "\(*)\" (size code removed to stop it changing size)
.Replacement.Font.Size = &H16
.Execute Replace:=wdReplaceAll
It looks as if different forums use different ways of changing size,
this one uses
HTML Code:
[SIZE="5"][/SIZE]
where the one I am doing all this on uses
HTML Code:
[size=150][/size]
** they are both similar. I can use size=150 here and it works. If I hit the 'sizes' box above it gives me "5".
What do you think is the word equivalent of this?
I tried &H16 as above .Replacement.Font.Size = &H16
but the macro crashes with that?