simple? Word Bookmarks link to Excel
I have a fairly complex problem that requires a simple solution. I hav a worksheet with many records in approximately 100 columns. I also hav a Word template with many bookmarks. I would like to link the bookmar entries to cells in the excel file so that when the file is updated s are the entries in the Word file. I can figure out how to do thi manually but no with VBA. Also, since there are several records I need to create a document fro the template for each of the records. All of these need to put on different page in a continuous Word document. Any and all help would be greatly appreciated!! -- JFamil ----------------------------------------------------------------------- JFamilo's Profile: http://www.excelforum.com/member.php...fo&userid=1727 View this thread: http://www.excelforum.com/showthread.php?threadid=38854 |
simple? Word Bookmarks link to Excel
Thank you! This is so much help. I can't wait to try it. Just one question though... will this link my bookmarks to my excel file so that if the excel file is updated then the bookmarks in the word file are updated too? I think I have to change the statement: Code: -------------------- appWD.ActiveDocument.FormFields("Surname2").Result = Worksheets(gCounter).Cells(gMyRow, 4).Value -------------------- But I don't know what I need to change it to to do the links. Thanks. -- JFamilo ------------------------------------------------------------------------ JFamilo's Profile: http://www.excelforum.com/member.php...o&userid=17276 View this thread: http://www.excelforum.com/showthread...hreadid=388545 |
simple? Word Bookmarks link to Excel
JFamilo,
Never used it, but Word has a Link option for a Field. Check out "Field codes: Link field" in Word Help. It appears to do what you want. NickHK "JFamilo" wrote in message ... Thank you! This is so much help. I can't wait to try it. Just one question though... will this link my bookmarks to my excel file so that if the excel file is updated then the bookmarks in the word file are updated too? I think I have to change the statement: Code: -------------------- appWD.ActiveDocument.FormFields("Surname2").Result = Worksheets(gCounter).Cells(gMyRow, 4).Value -------------------- But I don't know what I need to change it to to do the links. Thanks. -- JFamilo ------------------------------------------------------------------------ JFamilo's Profile: http://www.excelforum.com/member.php...o&userid=17276 View this thread: http://www.excelforum.com/showthread...hreadid=388545 |
simple? Word Bookmarks link to Excel
JFamilo,
The bookmarks aren't linked to XL. All my code does is to fill in the bookmarks for you from XL If you add, remove or rename any bookmarks, you'll have to add code to fill them. You could set up all the possible bookmarks on the Word Doc. and then use If statements to either put in whatever you want or, if you don't want to use them in some versions, put in "" or If condition Then ignore those "Result =" lines The other way around the problem would be to have several versions of your Word Doc and open the appropriate one. You would then need different code for each version. Henry "JFamilo" wrote in message ... Thank you! This is so much help. I can't wait to try it. Just one question though... will this link my bookmarks to my excel file so that if the excel file is updated then the bookmarks in the word file are updated too? I think I have to change the statement: Code: -------------------- appWD.ActiveDocument.FormFields("Surname2").Result = Worksheets(gCounter).Cells(gMyRow, 4).Value -------------------- But I don't know what I need to change it to to do the links. Thanks. -- JFamilo ------------------------------------------------------------------------ JFamilo's Profile: http://www.excelforum.com/member.php...o&userid=17276 View this thread: http://www.excelforum.com/showthread...hreadid=388545 |
All times are GMT +1. The time now is 12:30 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com