Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Is there anyway to resize graphs back to default with a button?
I made a button that applys a bookmark, but this still doesn't resize the graphs back to as when I loaded the document.
I want to keep the option to resize graphs though.
Try this in a macro:
ActiveDocument.GetSheetObject("CH01").Restore
rem ** restore all sheet objects on sheet Main **
set s=ActiveDocument.Sheets("Main")
for i=0 to s.NoOfSheetObjects-1
s.SheetObjects(i).Restore
next
If you did not mean via a button object, but just via chart properties, on the General tab of the chart properties there are a couple of reset buttons there as well. Reset User Sizing and Reset User Docking, which may also work for what you want here. This will only work via the Desktop client though, but it seems may be what you are trying to get done now that I reread your post. Hopefully it is the easiest solution for you. Server clients don't have the ability to get to those settings.
So how precisely do I use this code to make a macro? I pasted it in a edit module window.
How do I name the macro? I know how to call it with a button.
Is there anything else I'd have to do with the macro code other than change the name of CH01 to the appropriate charts?
Also, restoreing objects is an action for buttons, but it doesn't restore the graph sizes.
You can also restore your object without macro also.
Actions -> Add -> Layout -> In actions txtbox choose Restore Object and give the ObjectID which you want to restore.
If you want to do it in macro .
Sub Restore
ActiveDocument.GetSheetObject("CH01").Restore
End Sub
In button actions-> Add -> External -> choose Run Macro -> Give Restore in Macro Name txtBox.
You run this action after the bookmark apply action.
Hope it helps you.
The only issue is that restore doesn't restore the original column width. If you change that resotre doesn't restore that aspect.