View Single Post
 
Old 11-10-2014, 11:09 PM
gmayor's Avatar
gmayor gmayor is offline Windows 7 64bit Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,144
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

OK. I think . The code I originally posted demonstrates how to copy data from an Excel VBA userform to bookmark(s) in a Word document. If that is not what you want to do, what is it that you want to copy to either document and/or from one document to another and where does the userform come into it? A pair of buttons doesn't convey much.

The original code can easily be adapted to open a second document, and put data in that. However, you have referred to checking if a bookmark is filled in the first document to determine whether to write a value to a bookmark in the second document.

That would be easy enough, but it is essential to learn where the new data for that bookmark comes from, and what causes the value in the bookmark to change. If it is being changed by the Userform then there is no need to evaluate the bookmark content as you can use the fact that you have written to it to determine that it has been changed. Clearly it won't be changed by the simple process of opening it.

Why are there two buttons on the userform? Surely it would be possible to use only one to avoid even more confusion? The code could conditionally open a second document, or choose between two documents according to what information you have.

A more complete description of the process is therefore required.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote