Selection to New Page - Macro - Update

Sub SelectionToNewPage()
Dim sr As ShapeRange
Set sr = ActiveSelectionRange
sr.Cut
ActiveDocument.AddPages 1
ActivePage.ActiveLayer.Paste

End Sub

Can someone add this...

after moving the selection... immediately launch to rename the page option 

Parents
No Data
Reply
  • Converted to VBA by ChatGPT

    Sub MoveSelectionToNewPage()
    Dim sr As ShapeRange
    Set sr = ActiveSelectionRange

    If sr.Count = 0 Then
    Exit Sub
    End If

    Dim newPage As Page
    Set newPage = ActiveDocument.AddPages(1)

    Dim layer As Layer
    Set layer = newPage.ActiveLayer

    sr.MoveToLayer layer

    Dim proxy As DataSourceProxy
    Set proxy = Application.FrameWork.Application.DataContext.GetDataSource("WPageDataSource")
    proxy.InvokeMethod "OnRenamePage"
    End Sub

Children