1

Question: Is there any way to automatically set the margins of a foreground page in Visio 2007 to the margins of the corresponding background page?

Situation: My Visio 2007 document has a portrait background page and a landscape background page. They have the same margins, but rotated 90 degrees, so the top margin in the portrait page is the right margin in the landscape page.

Problem: If I insert a portrait foreground page (using the portrait background) and then insert a landscape foreground page (using the landscape background), the landscape page has the non-rotated margins of the portrait page.

VBA answers are fine if that's what it takes. Thanks for any ideas you can offer!

1 Answer 1

0

Well, I did some hunting and didn't find anything automatic. If you find an automatic way, please post! I am using the following macros, in a custom stencil per this, to fix up new pages after creating them. Change the 1, 0.625, 0.4 values to whatever margins you like (in inches, at least on a US installation of Visio and Windows).

Public Sub MarginsPortrait()
    Application.ShowChanges = False
    With ActivePage.PageSheet
        .Cells("PageTopMargin") = 1
        .Cells("PageLeftMargin") = 1
        .Cells("PageRightMargin") = 0.625
        .Cells("PageBottomMargin") = 0.4
    End With
    Application.ShowChanges = True
End Sub

Public Sub MarginsLandscape()
    Application.ShowChanges = False
    With ActivePage.PageSheet
        .Cells("PageRightMargin") = 1
        .Cells("PageTopMargin") = 1
        .Cells("PageBottomMargin") = 0.625
        .Cells("PageLeftMargin") = 0.4
    End With
    Application.ShowChanges = True
End Sub

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .