Rename Namespaces programmatically
<p>I tried this code in visual studio 2010, to rename Namespaces, but his do nothing</p>

<pre><code>public void RenameNamespaces()
{
    foreach (EnvDTE.Project aProject in DTE.Solution.Projects) {
        if (aProject.CodeModel != null) {
            foreach (CodeElement elem in aProject.CodeModel.CodeElements) {
                if (elem.Kind == vsCMElement.vsCMElementNamespace) {
                    CodeElement2 elm2 = (CodeElement2)elem;
                    elm2.RenameSymbol(GetNewName());
                }
            }
        }
    }
}
</code></pre>

<p>My question is how can I rename Namespaces programmatically?</p>