#1
|
|||
|
|||
Linking fields to pull values from one field to another
Hello all! This is my first post, so first let me say thank you in advance for any assistance! I hope I have some luck here!
So I work for an engineering company, and we have to plug in client document #s on a template. See below image... So the document number in large font at the top is directly plugged in via a link to a field in our database. Then at the bottom the document number has to be separated into 6 parts. I am trying to find out how to link these 6 parts back to the document number - but only the part that applies (as indicated by the arrows). Unfortunately our system cannot support filling in all these parts, so I am trying to get creative. If anyone has any suggestions, I am all ears (or eyes actually)! Thanks again! |
#2
|
||||
|
||||
Word cannot link to parts of a range. Given that the data are inserted from a database (is this a mailmerge?), the only way of automatically replicating the different parts of the document # in the table would be to insert them there directly from the database - which obviously contains all the elements of the document #. Other than that, a macro could be used to export the elements of the document # from the database output you presently have to the table. To do that, though, the macro would have to be able to definitively identify where the document # occurs in the document and where the output table is in relation to any other tables in the document.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
Thank you for your feedback, Macropod!
I honestly have no clue how the data is inserted into the template from the database as our IT department set it up. In our system we only have 3 columns that will link. If we had more, I would gladly enter all this data separately in different fields so that the info could pull into these fields automatically. I was really hoping there was a way to pull this off. However, your last suggestion about the possibility of a macro gave me a small glimmer of hope again. So if this is a standard template that will always pull the data from the exact same field and carry it down to the exact same field, does this seem easy enough to make that work? I will have to go find a guru somewhere that can build this macro for me, but if I know that is possible then at least I have hope! THANKS AGAIN!!!!!!!! |
#4
|
||||
|
||||
The macro could be fairly simple. For example, suppose the 'Document Number' paragraph is the always first in the document and the table is always the last table in the document:
Code:
Sub Demo() Application.ScreenUpdating = False Dim StrTmp As String, i As Long With ActiveDocument StrTmp = Replace(Split(.Paragraphs(1).Range.Text, ": ")(1), vbCr, "") With .Tables(.Tables.Count) For i = 0 To 5 .Cell(5, i + 2).Range.Text = Split(StrTmp, "-")(i) Next End With End With Application.ScreenUpdating = True End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Help with macro not working - Pull from fields > attaches doc from folder > sends email | mikey386 | Excel Programming | 2 | 01-08-2015 12:20 AM |
Automatic updating / Linking fields / cross referencing | Shaz | Word | 2 | 07-21-2014 09:43 PM |
Conditionally Email People Based on Values in Fields | dawsonh2002 | Mail Merge | 2 | 12-12-2012 12:11 PM |
Fields controlled by List box values | farfromapro | Word | 0 | 02-11-2009 02:19 PM |
Linking Text Fields in a document in Word 2007 | lcolson | Word | 0 | 12-22-2008 05:14 AM |