We were recently discussing big smartshapes and one issue kept nagging on me, how to re-order prop rows.
Why at all? It is not absolutely necessary since you can display the props in the order you want using the SortKey field.
But having the rows in proper order helps when maintaining the shape.
You can't just delete the prop section and rebeuild, it would break the formulas in all cells depending on the prop section. These cells can by anywhere in the shapesheet and even in other shapes.
First try - using ShapeReplace
- Make a new shape where the props are ordered the way you want. Fill in every information you find in the original.
- Replace this new shape by the new one, hoping that it will only rewrite the contents of the data rows.
--> Failed because it re-writes the prop section as in the original shape.
Second try - targeting the xml of the shape
- Copy the original shape in a virgin document, save and close
- Rename the vsdx into zip
- using the file explorer, enter the zip and navigate to \visio\pages.
- The target file is page-1.xml. Don't edit it directly in the zip file, it is read-only. Instead copy it to another location (eg Desktop).
- Edit the file.
- I used Visual Studio Code, because it has neat xml tools - I used the xml tools from Josh Johnson, but any other should probably do.
- The code comes as a 2 liner - hard to read. So you format it with with line breaks and indentations (Shift-Alt-F).
- Reorder the sections to your gusto.
- I don't know if it is really necessary, but I formatted the xml back to the 2 liner ("Minify xml").
- Save and close
- In the file explorer delete the file page-1.xml and copy the one from the desktop in it.
- Rename the zip file back to vsdx, open the file and save the shape to the stencil of your choice.
Caution: unzipping, editing and re-zipping did not work. I'm using 7-zip and it seems to pack the contents in a way Visio doesn't like.
That's why the a.m. method for editing the files.