Results 1 to 8 of 8
  1. #1
    5 Star Lounger
    Join Date
    Mar 2002
    Location
    Buenos Aires, Argentina
    Posts
    877
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Word Fields (Wd97)

    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
    <img src=/w3timages/blue3line.gif width=33% height=2>
    <img src=/S/flags/Argentina.gif border=0 alt=Argentina width=30 height=18> <big><font color=4682b4><font face="Comic Sans MS">Diegol</font face=comic></font color=4682b4> </big>

  2. #2
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word Fields (Wd97)

    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.

  3. #3
    5 Star Lounger
    Join Date
    Mar 2002
    Location
    Buenos Aires, Argentina
    Posts
    877
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word Fields (Wd97)

    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 [img]/forums/images/smilies/smile.gif[/img].

    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
    <img src=/w3timages/blue3line.gif width=33% height=2>
    <img src=/S/flags/Argentina.gif border=0 alt=Argentina width=30 height=18> <big><font color=4682b4><font face="Comic Sans MS">Diegol</font face=comic></font color=4682b4> </big>

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Word Fields (Wd97)

    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!

  5. #5
    5 Star Lounger
    Join Date
    Mar 2002
    Location
    Buenos Aires, Argentina
    Posts
    877
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word Fields (Wd97)

    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.
    <img src=/w3timages/blue3line.gif width=33% height=2>
    <img src=/S/flags/Argentina.gif border=0 alt=Argentina width=30 height=18> <big><font color=4682b4><font face="Comic Sans MS">Diegol</font face=comic></font color=4682b4> </big>

  6. #6
    Silver Lounger Charles Kenyon's Avatar
    Join Date
    Jan 2001
    Location
    Sun Prairie, Wisconsin, Wisconsin, USA
    Posts
    2,048
    Thanks
    124
    Thanked 119 Times in 116 Posts

    Re: Word Fields (Wd97)

    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.
    Charles Kyle Kenyon
    Madison, Wisconsin

  7. #7
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Word Fields (Wd97)

    Does this thread help: Numbering Invoices?

  8. #8
    5 Star Lounger
    Join Date
    Mar 2002
    Location
    Buenos Aires, Argentina
    Posts
    877
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word Fields (Wd97)

    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 <img src=/S/smile.gif border=0 alt=smile width=15 height=15> )

    VBA... maybe I'll start living for it <img src=/S/bow.gif border=0 alt=bow width=15 height=15>
    <img src=/w3timages/blue3line.gif width=33% height=2>
    <img src=/S/flags/Argentina.gif border=0 alt=Argentina width=30 height=18> <big><font color=4682b4><font face="Comic Sans MS">Diegol</font face=comic></font color=4682b4> </big>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •