1: \begin{abstract}
2: We study the group of type-preserving automorphisms of a right-angled building, in particular when the building is locally finite.
3: Our aim is to characterize the proper open subgroups as the
4: finite index closed subgroups of the stabilizers of proper residues.
5:
6: One of the main tools is the new notion of firm elements in a right-angled Coxeter group, which are those elements for which the final letter
7: in each reduced representation is the same.
8: We also introduce the related notions of firmness for arbitrary elements of such a Coxeter group
9: and $n$-flexibility of chambers in a right-angled building.
10: These notions and their properties are used to determine the set of chambers fixed by the fixator of a ball.
11: Our main result is obtained by combining these facts with ideas by Pierre-Emmanuel Caprace and Timoth\'ee Marquis
12: in the context of Kac--Moody groups over finite fields,
13: where we had to replace the notion of root groups by a new notion of root wing groups.
14: \end{abstract}
15: