Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-01-2016, 11:25 PM
DomiS DomiS is offline Copy and Paste a certain Page Windows 7 64bit Copy and Paste a certain Page Office 2010 64bit
Novice
Copy and Paste a certain Page
 
Join Date: Apr 2016
Posts: 1
DomiS is on a distinguished road
Exclamation Copy and Paste a certain Page

Hey everyone,
I’m currently trying to program a command button so that after you have clicked on it, a certain page of your document will be copied and gets paste on a certain page of the document.
Currently my code looks something like this:
Private Sub CommandButton1_Click()
Dim Select As String

Select = InputBox("Which Page do you want to duplicate?", "Copy Page")
If Selection = vbNullString Then Exit Sub

Dim pRange As Range

Selection.GoTo What:=wdGoToPage, Which:=wdGoToNext, Name:=Select
Set pRange = ActiveDocument.Bookmarks("\Page").Range
pRange.Copy

ActiveDocument.Characters.Last.Select
Selection.Collapse

Selection.Paste


End Sub
This Code pastes the copied page on the last page which I have to insert before. What I want is that I can paste the page wherever I want (an upcoming massage Box would be good that asks me where I want to put it). My Word Document has about 26 pages if that is necessary to know.
Is there also a possibility to copy and paste the makros that are on the page together with their functions?
You see, I’m completely new here, so hopefully you can help me!
Regards,
Dominik
Reply With Quote
  #2  
Old 06-02-2016, 04:59 AM
Charles Kenyon Charles Kenyon is offline Copy and Paste a certain Page Windows 8 Copy and Paste a certain Page Office 2013
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,081
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

A couple of thoughts:

  • Rather than a command button consider using a regular macro and a QAT icon stored in the document.
  • Word does not really think in terms of pages, but rather bookmarks, words, and paragraphs within sections. Pages comes up when it is time to print and can change depending on the printer driver being used.
  • Have you considered using AutoText? Automated Boilerplate Using Microsoft Word

What is it you are trying to accomplish by copying and pasting pages?
Reply With Quote
Reply

Tags
comman button

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Page Up & Copy/Paste Issues weamish Word 10 02-01-2014 08:25 PM
Copy and Paste a certain Page Copy Paste each cell to a new page Singh_Edm Word 12 01-20-2014 12:55 AM
Copy and Paste a certain Page Paste Special: Copy and Paste Formatting Only? tinfanide Word 6 03-06-2013 12:21 AM
Copy and paste words on right side of page Videolife Word 3 01-26-2013 12:54 PM
Copy and Paste a certain Page Find, copy and paste into a new page jperez84 Word VBA 24 09-20-2012 11:34 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:18 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft