Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Macro to copy line 1 - 8 page 1 to line 1 page 2....

Posted on 2011-03-01
1
429 Views
Last Modified: 2012-05-11
I want to create a macro in Word 2007 that will go to page 1 line 1 and copy line 1 - 8
Then paste to line 1 of page 2.

I would like to create this in VB instead of using the recording so the content doesn't matter only the lines and the page.
0
Comment
Question by:TKCONSTRUCTORS
1 Comment
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 50 total points
ID: 35009309
Is this what you need?
Sub CopyToPageTwo()
    Dim rng As Range
    
    With ActiveDocument
        Set rng = .Content
        rng.End = .Paragraphs(8).Range.End
        rng.Copy
        Set rng = .Range.GoTo(wdGoToPage, 2)
        rng.Paste
    End With
End Sub

Open in new window

0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Do you ever need to create a 20 page Word document for some testing purpose? Are you tired of copying & pasting old boring "lorem ipsum" text over and over again, increasing font size and line space in order to make the document 20+ pages long? Look…
Nice table. Huge mess. Maybe this was something you created way back before you figured out tabs or a document you received from someone else. Either way, using the spacebar to separate the columns resulted in a mess. Trying to convert text to t…
This video shows the viewer how to set up and create Footnotes in their document. Click on the References tab: Select "Insert Footnote": Type in desired text:
This Micro Tutorial well show you how to find and replace special characters in Microsoft Word. This is similar to carriage returns to convert columns of values from Microsoft Excel into comma separated lists.

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question