Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I Change Word Doc to Night Time Color Scheme?

Status
Not open for further replies.

ACH381

Technical User
Apr 3, 2002
49
US
Is there a way to change all the objects (text, tables, drawing objects, etc.) in a Word document to orange rather than white when the "Blue Background, White Text" option is selected in Tools - Options - General?

I need to change Word forms to a night time color scheme using dark blue, green, orange, and red for police officers to use at night to prevent the loss of night vision when completing forms. I have come up with a way using the Blue Background option then independently changing the text, table cell borders, etc., using VBA. However, the conversion tends to get very slow when there are a lot of cells, objects, etc., in the form.

Does anyone know of a way to make this conversion work quickly?
 
Try this:

Selection.wholestory

with selection
.font.color = wdcolororange
end with

with activedocument.background.fill
.forecolor.rgb = RGB(0, 0, 128)
.visible = msoTrue
.solid
end with



Asjeff
 
Sorry - that should say:

With ActiveDocument.select

(selection.Wholestory......etc)
 
asjeff:
Heres is the script. It doesn't like 'With ActiveDocument.Select'. It also doesn't change the table borders to orange, or the table backgrounds to blue they are apparently staying white.

I'd like to send you the whole form if you don't mind taking a look at it.

Sub Night()
UnlockForm
ActiveWindow.View.FullScreen = True
Options.BlueScreen = True
With ActiveDocument.Select
Selection.WholeStory

With Selection
.Font.Color = wdColorOrange
End With

With ActiveDocument.Background.Fill
.ForeColor.RGB = RGB(0, 0, 128)
.Visible = msoTrue
.Solid
End With
End With
Protect
ActiveDocument.Tables(1).Cell(1, 1).Select
End Sub
 
My mistake - there's a few things you need to do

Firstly get rid of the 'With' in 'With ActiveDocument.Select'

Secondly to change table border colours insert code along the lines of:

Selection.Tables(1).select
With selection.Tables(1)
With .Borders(wdBorderLeft)
.Color = wdColorOrange
End With
(do the same for wdBorderRight/Top/Bottom)
With Options
.DefaultBorderColor = wdColorOrange
End With

Finally it seems that you can only see these changes if you are in Web Layout View so you'll have to add some code to set that view (ActiveDocument.View.Type = wdWebView). How this will affect your application I dont know

You'll not need the 'Options.BlueScreen - True' line.

Asjeff


Asjeff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top