I need to temporarily hide/remove/detach a page so I can export the template and then later show/add/attach the page again so I can export it (this time with the page).
How do I do this using a script?
I tried this but doesn:
List<Page> pages = new Page(); //Pages to temporarily remove and hold till the first export is done
This throws a null reference error because when the page is deleted, it destroys the reference in List<Page> pages as well.
This is not a good workflow.
You cannot temporarily remove a page -- once you remove it is gone for good -- unless it is still in the Undo history, but I would not feel comfortable relying on that in production.
The obvious answer is to simply export the page first.
If for some reason that is not workable, I would Save As to a temporary file, delete the page, and then revert to my saved temporary file.