Thanks for all comments.
Fumei- The point of the code I posted was just to show that when the data inside the bookmark is deleted the duplicate range also ends up containing no data. The example didn't really have anything to do with deleting the bookmark or not.
I know you can't technically...
Ok, well I didn't mean to post that yet, but the code above works if I comment out the two lines below "'Delete the information in the original range".
If those lines run I get an error message on the "myRange.copy" line:
"This method or property is not available because no text is selected."...
I had thought of the duplicate thing, but that doesn't seem to work. Here is some sample code:
Function test()
'Variable declaration
Dim m_objWord As word.Application
Dim m_objDoc As word.Document
Dim m_objDoc2 As word.Document
Dim myRange As Range
'Setup 2...
Hey,
Thanks for the idea. I had thought of that as well and may try it out. I just thought it seemed silly to have a create a whole document just to store some temporary stuff. I was hoping their would be another way to do it, but maybe there isn't...
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...
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.