Hi Klaus,
Try just adding the literal characters in the variable definition instead of the symbolic codes that you enter in the interface. The symbolic codes are only for the GUI, but when you query the definition programmatically, you see the literal character. In other words, instead of inserting a non-breaking space with this \\ , use this \x11 instead.
#target framemaker
var doc, varFmt;
doc = app.ActiveDoc;
varFmt = doc.NewNamedVarFmt ("TestValue");
varFmt.Fmt = "99\x11mm";
-Rick