0

Specifically, I was looking at the Rows.HeadingFormat Property

Property Value

Int32

Remarks

This property returns true if the specified row or rows are formatted as a table heading, and false if not.

Rows formatted as table headings are repeated when a table spans more than one page.

This values this property can be set to are True, False and wdUndefined.

I had incorrectly assumed that 1 was true and 0 was false until I found the answer in a different thread. Why is -1 evaluated as true? and How are you supposed to know that/figure it out?

I googled around to see if that was a common convention, but I wasn't turning up any useful results.

Thanks!

Community
  • 1
  • 1
  • 1
    It was a common convention in old-fashioned 1990s Visual Basic. And, Excel automation derives from 1990s VB. The reason is the a value of -1 has *all* bits in the value set to 1 (well, that's what I always assumed). – Flydog57 Mar 12 '20 at 18:32
  • 1
    Yes, it's because boolean not was done as a bitwise not, and FWIW, that boolean (VT_BOOL) is 16 bits. – madreflection Mar 12 '20 at 18:34
  • 1
    In general, it is best to assume that <>0 is true and 0 is false, but not to assume any particular value for true (the Perl/C model). – NetMage Mar 12 '20 at 18:36
  • You might find this useful: https://stackoverflow.com/questions/59310779/vba-why-would-the-not-operator-stop-working/59311115#59311115 – Cindy Meister Mar 12 '20 at 18:43

0 Answers0