Another problem is the first parameter in the call to AddAnnotation - instead of
‘Map |’ + MapName
it should be
‘Map|’ + MapName
i.e. no space character between ‘Map' and ‘|'
Thanks, but in my code is no space character:
Gisdk.RunMacro('AddAnnotation', 'Map|'+MapName, 'Font Character', spec);
(You can copy and paste it to notepad to check it. The pipe | character has some white space arround it. It may look like a space character. But it isn't)