1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Word VBA-Copy range to variable for later use?

Discussion in 'Business Applications' started by rocket5556, Aug 9, 2007.

Thread Status:
Not open for further replies.
  1. rocket5556

    rocket5556 Thread Starter

    Joined:
    Jun 22, 2007
    Messages:
    15
    Hi,

    I am trying to find a way to use VBA to copy some information (including text, tables, bookmarks, etc.) out of a Word document and then use it several times in the same document without relying on it remaining in the clipboard the whole time.

    Currently what I am doing is cutting the range out of the document, pasting in back in, changing all the bookmark names, and then pasting the range in again (this preserves the original bookmark names for later copying and pasting). As you might imagine, this is not a very quick process when it has to be done over and over again and there are quite a few bookmarks.

    Is there some type of a variable that I could use to store this information and then insert it when I need it? I have tried a Range variable, but if I use a range variable for the original and then delete the original, the range variable essentially holds nothing. I need a way to keep all that information in storage.

    An additional note. I found that I could paste the contents into an access object frame and this could be later used to retrieve the information, but this isn't a very elegant solution, and I don't want to have to rely on this. Isn't there a comparable data type that could store this stuff?

    Thoughts?

    Thanks!
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/607381

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice