Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Folks,
Please help me with syntax error.
Thanks,
AS
Amit,
Check the attachment.
Hi
Remove the spaces in your code where you use _
Sub SetColorPrefs()
Dim UserPrefs
set UserPrefs = _
ActiveDocument.GetApplication.GetUserPreferences
' Set the "Selected" Color
UserPrefs.CustomSelBgColor(1).PrimaryCol.Col = _
RGB (0,0,255) ' Blue
UserPrefs.CustomSelFgColor(1).PrimaryCol.Col = _
RGB (255,255,0) ' Yellow
' Set the "Possible" Color
UserPrefs.CustomSelBgColor(2).PrimaryCol.Col = _
RGB (255,255,0) ' Yellow
UserPrefs.CustomSelFgColor(2).PrimaryCol.Col = _
RGB (0,0,0) ' Black
' Set the Excluded Color
UserPrefs.CustomSelBgColor(5).PrimaryCol.Col = _
RGB (200,200,200) ' Light gray
UserPrefs.CustomSelFgColor(5).PrimaryCol.Col = _
RGB (0,0,0) ' Black
' Set the Locked Color
UserPrefs.CustomSelBgColor(0).PrimaryCol.Col = _
RGB (255,0,0) ' Red
UserPrefs.CustomSelFgColor(0).PrimaryCol.Col = _
RGB (0,0,0) ' Black
ActiveDocument.GetApplication.SetUserPreferences _
UserPrefs
end sub
hope this helps