Private Sub CommandButton1_Click()
Dim UndoScopeID1 As Long
UndoScopeID1 = Application.BeginUndoScope("Insert Page")
Dim vsoPage1 As Visio.Page
Set vsoPage1 = ActiveDocument.Pages.Add
vsoPage1.Name = "Page-" & Pages.Count
vsoPage1.Background = False
vsoPage1.Index = 3
vsoPage1.PageSheet.CellsSRC(visSectionObject, visRowPage, visPageWidth).FormulaU = "420 mm"
vsoPage1.PageSheet.CellsSRC(visSectionObject, visRowPage, visPageHeight).FormulaU = "297 mm"
vsoPage1.PageSheet.CellsSRC(visSectionObject, visRowPageLayout, visPLOSplit).FormulaU = "1"
vsoPage1.PageSheet.CellsSRC(visSectionObject, visRowPrintProperties, visPrintPropertiesPageOrientation).FormulaU = "2"
vsoPage1.PageSheet.CellsSRC(visSectionObject, visRowPrintProperties, visPrintPropertiesPaperKind).FormulaU = "8"
Application.EndUndoScope UndoScopeID1, True
End Sub