Hi. I have this macro called 'Update' and it will run through and renumber pages. However, If I click Undo in the tool bar it does not roll back to the point before the pages were all renumbered. Am I missing something?
Sub update()Dim pageThis As PageDim s As ShapeActiveDocument.BeginCommandGroupOptimization = True For Each pageThis In ActiveDocument.Pages Set sPageNumThis = pageThis.Shapes.FindShape("pagetotal") If Not sPageNumThis Is Nothing Then sPageNumThis.Text.Story = CStr(ActiveDocument.Pages.Count) End If Next pageThisOptimization = FalseActiveDocument.EndCommandGroupEnd Sub
Do you see this problem if you just run the macro manually from the Scripts docker?
Or only when this sub is being called by some other sub?
Have not run it from the scripts docker, just called by another sub when I add or remove a page. I can't seem to recreated the issue now but adding '.Refresh' helps a little.