4 Replies Latest reply: Apr 7, 2011 5:04 PM by Sally Hurley RSS

    Macro randomly does not set variable?

    Sally Hurley


      I have a macro that sets variables that is setting a start and end age:

      ActiveDocument.Variables("vAgeEnd").SetContent "63", true
      ActiveDocument.Variables("vAgeStart").SetContent "23", true

      There are all sorts of age ranges that it sets, based on a number of things in the system. Occasionally, it will set one age, and not the other. I found that if I changed the order of the settings (Usually I set vAgeStart first, then the vAgeEnd) it "fixes" the problem, but then later on, if I happen to be coming from a particular selection, it won't work. In some cases, in the one macro, I set these two variables more than once.


      Has anyone ever seen anything like this? Is it a known problem? Its killing me, because I'm constantly rechecking my code, thinking I've programmed something wrong.