Hi,
Suppose I want to swap Page 3 with Page 6,
is there a convenient to do so, instead of using copy & paste?
Thanks.
Hi,
Suppose I want to swap Page 3 with Page 6,
is there a convenient to do so, instead of using copy & paste?
Thanks.
There are no pages in a Word document. It is not a page layout application. Displayed 'pages' are also made up of several overlaid layers or story ranges which make up the results you see. Copying the content of a 'page' to another location is not a straightforward task and much depends on what is actually in the document and what associated elements need to be moved also.
Graham Mayor - MS MVP (Word) 2002-2019
Visit my web site for more programming tips and ready made processes
http://www.gmayor.com
Graham is correct. In many many cases this just can't be done or if can it would take more effort to code than it is worth. However, just for the sake of demonstration, in a basic document e.g., no drawings, textboxes, headers, footers, textboxes, footnotes etc, you can have "limited" success using the .Panes, .Pages and .Rectangle objects of the document.
For example, if you had a "5" page document where pages 1 though 4 have defined text (anything even empty paragraphs) filling the complete page, then you could reverse the order of pages 1-4 to display the text 4-1
Sub ScratchMacro() Dim oDoc As Document Dim oDocSP As Document Set oDoc = ActiveDocument Set oDocSP = Documents.Add(ActiveDocument.FullName) oDoc.Activate With ActiveDocument.ActiveWindow.Panes(1) .Pages(1).Rectangles(1).Range.FormattedText = oDocSP.ActiveWindow.Panes(1).Pages(4).Rectangles(1).Range.FormattedText .Pages(2).Rectangles(1).Range.FormattedText = oDocSP.ActiveWindow.Panes(1).Pages(3).Rectangles(1).Range.FormattedText .Pages(3).Rectangles(1).Range.FormattedText = oDocSP.ActiveWindow.Panes(1).Pages(2).Rectangles(1).Range.FormattedText .Pages(4).Rectangles(1).Range.FormattedText = oDocSP.ActiveWindow.Panes(1).Pages(1).Rectangles(1).Range.FormattedText End With oDocSP.Close wdDoNotSaveChanges lbl_Exit: Set oDoc = Nothing: Set oDocSP = Nothing Exit Sub End Sub
IF you don't know the answer then you have no right to mislead our forum members.
Graham Mayor - MS MVP (Word) 2002-2019
Visit my web site for more programming tips and ready made processes
http://www.gmayor.com
Agreed.
LOL I doubt that.
What the heck is that credit card generator link doig in his quote?
Last edited by Kilroy; 09-19-2019 at 07:05 AM.
Thanks a lot for information! I was searching similar solution
Not a vba solution but using the Navigation Pane, you can move sections which use headings.
Moving/Reorganizing Pages in Microsoft Word