Results 1 to 7 of 7
  1. #1
    New Lounger
    Join Date
    Feb 2014
    Posts
    12
    Thanks
    0
    Thanked 1 Time in 1 Post

    Moving paragraphs up/down in a table

    I want to move a bullet point entry up/down list that is in a table cell. I've tried the OutlineMoveUp/Down and range.relocate functions. These work fine in regular text, but seem to operate at the row level in a table, and move the entire row up/down. Have I missed something obvious? Has someone got a piece of working code that I could use? Ideas welcome

  2. Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    3,898
    Thanks
    0
    Thanked 188 Times in 172 Posts
    Is there a reason you can't just go to the table cell and do the dragging within the cell there?
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  4. #3
    New Lounger
    Join Date
    Feb 2014
    Posts
    12
    Thanks
    0
    Thanked 1 Time in 1 Post
    I have been managing a lot of information in bulleted lists over the last few months, both in regular text and tables. I like the efficiency of the OutlineMoveUp/Down shortcut (Alt+Shift+up/down) that I can use in standard text, and I'd like to set up a macro that gives me equivalent capability inside tables. I would combine the two types into a single marco and use he selection context to decide which to use . The macro needs to handle a number of "text in cells" manipulations (e.g. handling the end of cell marker) and I was wondering if anyone had been there before me.

  5. #4
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,515
    Thanks
    3
    Thanked 143 Times in 136 Posts
    I think there is a lot of checking to make this a workable method but the following might get you started
    Code:
      If Selection.Information(wdWithInTable) Then
        Set rng = Selection.Previous(Unit:=wdParagraph, Count:=1)
        rng.InsertBefore Selection.Paragraphs(1).Range.FormattedText
        Selection.Paragraphs(1).Range.Delete
      End If
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  6. #5
    New Lounger
    Join Date
    Feb 2014
    Posts
    12
    Thanks
    0
    Thanked 1 Time in 1 Post
    Thanks Andrew - I think you are right about the testing. I'll start with this, and give an update to the thread in the next week or so.

  7. #6
    New Lounger
    Join Date
    Feb 2014
    Posts
    12
    Thanks
    0
    Thanked 1 Time in 1 Post
    Hi Andrew

    Thanks for challenging me to create a routine that moves paragraphs up and down in a table cell using logic similar to OutlineMoveUp. You were right about all the checking required. I had to make some compromises because of the way Word marks the end of the cell, and what happens if you select this character. I also learned a lot about paragraph boundaries in bulleted lists too.

    To work around these I chose to allow only one paragraph to be moved at a time and enforced this in the code buy checking for the insertion point. Using this I was able to incorporate the standard OutlineMoveUp/Down logic, so I now have a routine that does both which I have attached to the standard shortcut keys.

    There are probably some improvements to be made, but it works, and reuses a number of other standard routines I have developed for table handling.

    I have posted the details here if anyone is interested, although perhaps they, like me, probably need to get out more...

    Thanks again.

  8. #7
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,515
    Thanks
    3
    Thanked 143 Times in 136 Posts
    Well done Martin

    I'm glad you got it sorted out and included solutions to the various issues of selection, position in cell, end of cell marker and bullets. I expect that the starting question was only the tip of the iceberg
    Andrew Lockton, Chrysalis Design, Melbourne Australia

Posting Permissions

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