• Word Fields (Wd97)

    Author
    Topic
    #370706

    Hi everyone,

    I think Word fields might be useful for my general use of Word, but don’t know how to get started. For example, I need to have Word look for certain data in an Excel cell in a file, then use it in a letter Re.:
    When highlighting the Link field, Word shows a field code and the Options dialog box, but I don’t know how to handle the first and the second doesn’t seem to be the right place to point Word to the Excel file…
    Can this be done in Word?

    TIA

    Viewing 2 reply threads
    Author
    Replies
    • #587194

      You can use a Word Macro to get info from Excel.

      Take a look at the list of Word VBA books at my URL below.

      You may also wish to look at Excel VBA. Try the book by Steve Roman or the book by John Walkenbach.

      • #587209

        Hi Howard, your page is really cool, but I’m not looking for an entire book on VBA.

        I’ve read one and overread several others and come to the conclusion that unless you decide to live for VBA, reading books is no real use (at least for me). You either know the whole of it or just the basics, I mean, VBA learning isn’t as linear as Word, Excel, PPT, etc. learning. VBA is sooo ample that if I wanted to find out how to write the code that would make word take the info from excel, I’d have to go thru one or maybe two books until I get to know a big part of it and only then come up with the right macro… thing I’m not willing to do since I decided “not to live for it” – at least so far .

        Anyway, I manage to understand VBA code most of the times. If you would drop me the lines of code you happened to use for word to take info from excel, maybe I could edit and make them work for me.

        And if any of you have info on word fields, I’d really appreciate it. I just can’t get them to work (I tried the Link field – totally clueless).

        Thanks a lot

    • #587248

      To extract a single cell out of an Excel file for a single use, it is not efficient to link to it: Word will have to load Excel and your file in the background to get the information. Anyway, to create a LINK field, the best way probably is to go through Insert|Object…

      Can you describe your application in a little more detail? Do you need to merge a bunch of Excel data into different Word documents? If so, perhaps a merge is the answer. If not, copy and paste would probably be best!

      • #587695

        Sorry for the delay in response.

        The idea is: have word automatically number documents in the Re: field. Numbers should not repeat. For example, I use the Proposal Template to create and send an economic proposal to the customer with a certain Re. number; then another one uses the Template and word will assign it another number. And so on.

        Notes:

        – The Template document should preferably not be in a network server for anyone to use, since sales executives should be able to customize it to their liking. So it’d be in each vendor’s HD.
        – The numbers word assigns to proposals should not repeat (not only one sales exec.’s proposals but the whole sales team’s proposals). That is, none of the numbers Word assigns to a certain sales exec.’s proposals should match any of the numbers word has assigned to any of his other proposals nor any of the other exec.’s proposals.

        I thought of an excel file stored in a network server that would have number “00000001” in cell “A1”; so I’d have word link to that number, and excel create the following immediate number below that cell / in that same cell (hadn’t defined it yet) with a simple macro for word to use in the next proposal. But the first step was: how to make word to get a number from the excel file. Then I’d figure the rest. So I checked Word Fields and started the Trial n’ Error phase.
        Having read the field’s descriptions, the one that seemed to come closest to my pretensions was “Link”. But there is no “Browse” button to grab the excel file, just a field code sintax I don’t know how to handle… Now I realize the description “Inserts part of a file using OLE” must have something to do with pictures, right? I’m not sure.

        Hope this wasn’t too confusing.

        • #587772

          Does this thread help: Numbering Invoices?

          • #588224

            UNBELIEVABLE!!!!

            I could come up with the macro. Just gave the original code a little twist: the macro inserts the number stored in the txt increased by 1 after the Re.:; then copies the entire document (selection.wholestory / selection.copy); creates a new document; pastes the info in the new document; saves the new document as the number stored in the txt file added in 1 in a network directory, then closes the original template without saving changes. Result: a network folder with indexed files containing each their respective numbers in the Re.: field, and WITHOUT containing any VBA code (that’s what all the copy / paste stuff was about – the code remains in the .dot file, while the resulting .docs are “codeless”, so the customer won’t be prompted with the macro security alarm).

            Thanks a lot Jeff to you and Charles too (he asked the post you linked me to anyway smile )

            VBA… maybe I’ll start living for it bow

    • #587723

      If you name the cell in Excel holding your information, I think you can link to it using Insert => File.

      You need to be able to find the file and then know the name of the cell. You’ll probably want to insert as a link.

      For more about fields, follow the links at Word Web Resources – Fields (addbalance.com/word/wordwebresources.htm) especially Cindy Meister’s series of articles.

    Viewing 2 reply threads
    Reply To: Word Fields (Wd97)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: