Can you take advantage of flanking positions with a ranged weapon?

There appears to be some controversy over whether or not a ranged attacker can ever be considered to be flanking his target. Is it true that it is impossible to flank enemies with a ranged weapon? What about the first line of the flanking rules, which state:

When making a melee attack, you get a +2 flanking bonus if your opponent is threatened by another enemy character or creature on its opposite border or opposite corner.

Some people claim that this means you can only be considered flanking an enemy while you are currently making a melee attack, is that true?

In general, are you ever considered to be flanking a target while attacking with a ranged weapon and are there any situations in which this distinction could possibly matter?