Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    May 2015
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Append text with formatting inside cell in Word table

    Hi All

    I am trying to devise a line of VBA macro code that would paste the text from the clipboard into a Word table cell, by appending it to the text already present in the cell. I have made several attempts by using collapse but always ended up with the text in the cell being overwritten by the the text I paste. Any idea on this? Thanks!

  2. #2
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,853
    Thanks
    4
    Thanked 259 Times in 239 Posts
    Does your clipboard include a full table cell? If the copied contents include that end of cell marker then a standard paste is going to overwrite the entire cell contents.

    You may need to paste special as text only to avoid that issue.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  3. #3
    New Lounger
    Join Date
    May 2015
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi,
    Thanks for your reply. Yes, it does contain a full cell. At the same time, I need to be able to paste the text along with its formatting information. Is there a paste special VBA command that does that? Unfortunately, I am not a professional programmer... thanks!

  4. #4
    New Lounger
    Join Date
    May 2015
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Also, would replacing the ^p character with some other character (e.g. a vertical tab) solve the cell boundary issue?

  5. #5
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,853
    Thanks
    4
    Thanked 259 Times in 239 Posts
    The end of cell marker is the very last thing in the cell. If you temporarily add a return at the end of the cell and copy everything EXCEPT the end of cell marker then you should be able to paste that content in without wiping the existing cell contents.
    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
  •