3 Replies Latest reply on Mar 24, 2008 7:18 PM by (Brian_W_McMahon)

    View preferences don't change

      Hi.

      I am scripting InDesign CS2 using VBA (the last one left in the universe?).

      I have been trying to change the measurement units and ID is not reacting, even though the code seems to work.

      myInDesign.ViewPreferences.ShowRulers = False
      myInDesign.ViewPreferences.HorizontalMeasurementUnits = idMillimeters
      myInDesign.ViewPreferences.VerticalMeasurementUnits = idMillimeters

      When I use MsgBox to look at the values they have changed in the script but when I go back to ID it has not changed. (But I can change them manually in ID.)

      Yet other ViewPreferences do work, like RulerOrigin.

      Thanks for any advice.
        • 1. Re: View preferences don't change
          Level 1
          > I am scripting InDesign CS2 using VBA (the last one left in the universe?).

          what you mean ?? ;)

          robin

          --
          www.adobescripts.com
          • 2. Re: View preferences don't change
            srakete Level 1
            Brian,

            I suppose the document settings wins over the application settings. Try change the viewPreferences for the document. These property exists for the document as well:

            myDocument.ViewPreferences.ShowRulers = False
            myDocument.ViewPreferences.HorizontalMeasurementUnits = idMillimeters
            myDocument.ViewPreferences.VerticalMeasurementUnits = idMillimeters

            Stefan
            • 3. Re: View preferences don't change
              Level 1
              Hi, Robin.

              That comment was meant to be a joke. It looks as if most of the scripters on the forum are now using Java and CS3. I have not done any scripting in a few years and don't know Java (and haven't upgraded to CS3) so I was wondering how many people would be around who still use VB.

              Hi, Stefan.

              Thanks for your comment. You are exactly right and have solved my problem. When I change the preferences for the document instead of the application, everything works. Not sure why I missed the document view preferences before but these things happen. Thanks again.

              Brian