Quote:
Originally Posted by Italophile
It is very rare that you need to select anything when using VBA code. Here is your routine rewritten to avoid selecting the text.
Code:
Sub AutoOpen()
'
' AutoOpen Macro
'
' This macro opens itself (AutoOpen) automatically with every Word document that's opened normally
' Choose background colour (light green 2)
With ActiveDocument.Background.Fill
.ForeColor.ObjectThe meColor = wdThemeColorAccent6
.ForeColor.TintAndSh ade = 0.6
.Visible = msoTrue
.Solid
End With
' Turn option 'Show background colors and images in Display view' on
ActiveWindow.View.DisplayBackgrounds = True
' Select all text and change font to black colour
ActiveDocument.Content.Font.Color = wdColorBlack
End Sub
|
Thank you, yes, this was better than what I could come up with, thank you very much!