+ Reply to Thread
Results 1 to 2 of 2

Move the insertion point in Word with VBA - How

  1. #1
    Valued Forum Contributor
    Join Date
    06-19-2010
    Location
    Holywell, N Wales, UK
    MS-Off Ver
    Excel 2013
    Posts
    470

    Move the insertion point in Word with VBA - How

    Hi Everyone

    How do you move the insertion point in Word using VBA (from Excel)?

    I want to progressively move the insertion point lower down in the Word doc to add more content.

    My scenario is:
    I'm running a VBA macro from within Excel VBA
    In Excel create a Word doc - can do
    At the top of the Word document add a text heading - can't do
    Copy and paste an Excel range into Word - can do (it goes in as a Table)
    Create a couple of lines of space after this Table- can't do
    Add another text heading - can't do
    Copy and paste a second Excel range into Word - can do
    etc.
    ...but don't get the desired effect

    Can any one give me a lead please.
    WTIA
    barry
    Last edited by barryleajo; 12-05-2010 at 06:50 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    06-19-2010
    Location
    Holywell, N Wales, UK
    MS-Off Ver
    Excel 2013
    Posts
    470

    Re: Move the insertion point in Word with VBA - How

    OK - No replies so not sure if my request was difficult, trivial or confusing?
    In the spirit of maybe helping others I have moved this on and got something working now.

    My scenario is:
    I'm running a VBA macro from within Excel VBA
    In Excel create a Word doc - can do
    At the top of the Word document add a text heading - can't do
    ActiveDocument.Paragraph(1).Range and set the .Text property
    Copy and paste an Excel range into Word - can do (it goes in as a Table)
    Create a couple of lines of space after this Table- can't do
    Go to the end of the .Paragraph.Range (see below) and use .Range.InsertParagraphAfter
    Note that you may need to keep track of paragraphs for later navigation

    Add another text heading - can't do
    As above with the appropriate .Paragraph
    Copy and paste a second Excel range into Word - can do
    Setting a Range 'selects' it; to 'deselect' and go to the end/beginning of the Range use the Collapse method.
    Use with care as may not be entirely accurate as I am just learning this but this info would have moved me on at the time.

    Any moderators out there - please now mark as SOLVED please - thanks

    barry

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1