View Single Post
 
Old 09-13-2014, 08:13 PM
alantnz alantnz is offline Windows 7 32bit Office 2013
Novice
 
Join Date: Sep 2014
Posts: 1
alantnz is on a distinguished road
Default font color change problem

I use the following macro

Code:
Sub DIAMOND()
'
' DIAMOND Macro
'
'
With Selection.Range
  .InsertBefore ChrW(&H2666)
  .Font.ColorIndex = wdRed
End With
Selection.Move Unit:=wdCharacter, Count:=1
With Selection
  .Font.ColorIndex = wdAuto
End With
End Sub
It prints a red diamond symbol but reverts to a black font for the next character. However when I try to embed this in a longer macro (part of which follows) the next character does not revert to black
Code:
Sub fourhand()
'
' fourhand Macro
'
'
ActiveDocument.Tables.Add Range:=Selection.Range, NumRows:=3, NumColumns:= _
3, DefaultTableBehavior:=wdWord9TableBehavior, AutoFitBehavior:= _
wdAutoFitFixed
With Selection.Tables(1)
  If .Style <> "Table Grid" Then
    .Style = "Table Grid"
  End If
  .ApplyStyleHeadingRows = True
  .ApplyStyleLastRow = False
  .ApplyStyleFirstColumn = True
  .ApplyStyleLastColumn = False
  .ApplyStyleRowBands = True
  .ApplyStyleColumnBands = False
End With
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.InsertSymbol Font:="Arial", CharacterNumber:=9824, Unicode:=True
Selection.TypeParagraph
With Selection.Range
  .InsertBefore ChrW(&H2665)
  .Font.ColorIndex = wdRed
End With
Selection.Move Unit:=wdCharacter, Count:=1
With Selection
  .Font.ColorIndex = wdAuto
End With
End Sub
Can anyone help please?

Last edited by macropod; 09-15-2014 at 04:07 PM. Reason: Added code tags & formatting
Reply With Quote