2 Replies Latest reply: Mar 10, 2016 3:15 AM by Sasidhar Parupudi RSS

    Macro correction help!

    Amit Saini

      Hi Folks,

       

      Please help me with syntax error.

       

       

      Thanks,

      AS

        • Re: Macro correction help!
          Tamil Nagaraj

          Amit,

           

          Check the attachment.

          • Re: Macro correction help!
            Sasidhar Parupudi

            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