Results 1 to 11 of 11
  1. #1
    3 Star Lounger
    Join Date
    Jun 2009
    Location
    Hemet CA
    Posts
    310
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Talking

    I have a User Form on my Word docm that has data that I would like to link to a 4 other docm. Is there a way to do this

  2. #2
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts
    [quote name='ababenchrist' post='788126' date='08-Aug-2009 23:26']I have a User Form on my Word docm that has data that I would like to link to a 4 other docm. Is there a way to do this[/quote]
    It would be useful if you could sketch out in some more detail, the overall picture of what you're trying to do. For starters, do you always expect to have all five documents open at the time the userform is being worked with, or do you need the code to open each of the other four documents and update data into them?

    A very simple way to do something like this - which may or may not be appropriate to what you're trying to do - would be to use code to populate bookmarks in multiple documents (this example assumes that all the documents are going to be open - and assumes 2 other documents rather than 4, just to save space):

    Code:
       Dim strLastName As String
       Dim Doc1 As Document
       Dim Doc2 As Document
       
       Set Doc1 = Documents("Doc1Name")
       Set Doc2 = Documents("Doc2Name")
       
       strLastName = txtLastName.Text
       
       'Populate data into active document plus 2 other open documents:
       ActiveDocument.Bookmarks("bmkLastName").Range.Text = strLastName
       Doc1.Bookmarks("bmkLastName").Range.Text = strLastName
       Doc2.Bookmarks("bmkLastName").Range.Text = strLastName
       
       Set Doc1 = Nothing
       Set Doc2 = Nothing
    Gary

  3. #3
    3 Star Lounger
    Join Date
    Jun 2009
    Location
    Hemet CA
    Posts
    310
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi Gary
    At the present I am using a worksheet called "Client Info" that I enter data about a client and locations. I have the data linked (Excel Binary worksheet object) to actually 10 different docm, that I use for my reporting. I was wanting to eliminate the worksheet and use a User Form from Word instead. I was thinking of eliminating Excel all together and keep it simple with just Word.


    Here is a veiw of my worksheet

    [attachment=85033:report.JPG]
    Attached Images Attached Images

  4. #4
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts
    [quote name='ababenchrist' post='788159' date='09-Aug-2009 09:53']Hi Gary
    At the present I am using a worksheet called "Client Info" that I enter data about a client and locations. I have the data linked (Excel Binary worksheet object) to actually 10 different docm, that I use for my reporting. I was wanting to eliminate the worksheet and use a User Form from Word instead. I was thinking of eliminating Excel all together and keep it simple with just Word.[/quote]
    Hi again,

    Nice form!

    It all depends on what you need to do with this data - if the data is collected into the form, and then gets put into the 10 different docs, and the different docs are the only place that you intend to store the data, then there really isn't any need for the intermediate step of putting it into an Excel worksheet. If you need to persist the data in Excel for any other purpose, then of course you should stick with Excel.

    hth,
    Gary

  5. #5
    3 Star Lounger
    Join Date
    Jun 2009
    Location
    Hemet CA
    Posts
    310
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='Gary Frieder' post='788213' date='09-Aug-2009 20:41']Hi again,

    Nice form!

    It all depends on what you need to do with this data - if the data is collected into the form, and then gets put into the 10 different docs, and the different docs are the only place that you intend to store the data, then there really isn't any need for the intermediate step of putting it into an Excel worksheet. If you need to persist the data in Excel for any other purpose, then of course you should stick with Excel.

    hth,
    Gary[/quote]

    Hi Gary
    I agree thatís why I was going to put my data on a Word User form and eliminate Excel all together, plus a user form looks better and also since all my other docm are word. I'm just not sure how to link different data from a user form to a word docx then from there I can apply my other links as necessary.
    What might be your thoughts

  6. #6
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts
    [quote name='ababenchrist' post='788217' date='10-Aug-2009 00:23']Hi Gary
    I agree thatís why I was going to put my data on a Word User form and eliminate Excel all together, plus a user form looks better and also since all my other docm are word. I'm just not sure how to link different data from a user form to a word docx then from there I can apply my other links as necessary.
    What might be your thoughts[/quote]
    Still not sure I have a clear idea of what you're trying to do - if you're just trying to get data one-way from a userform into a Word doc, there's some simple code for doing that, further up in the thread.

    If on the other hand by "link" you mean that you want data to be able to be updated in two directions - from the userform to the document, but also from the document to the userform when it's reopened, that can also be done - but how you do it, depends on what you are trying to do: Can you provide a brief overview of what the userform and documents are for? What is your intended workflow for the user?

    Gary

  7. #7
    3 Star Lounger
    Join Date
    Jun 2009
    Location
    Hemet CA
    Posts
    310
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Talking

    [quote name='Gary Frieder' post='788235' date='10-Aug-2009 02:16']Still not sure I have a clear idea of what you're trying to do - if you're just trying to get data one-way from a userform into a Word doc, there's some simple code for doing that, further up in the thread.

    If on the other hand by "link" you mean that you want data to be able to be updated in two directions - from the userform to the document, but also from the document to the userform when it's reopened, that can also be done - but how you do it, depends on what you are trying to do: Can you provide a brief overview of what the userform and documents are for? What is your intended workflow for the user?

    Gary[/quote]

    Hi Gary
    My objective is when I start a report I will first enter information needed (name, address ect.) on a User Form, Word2007 (Text boxes) that I will call ďClient InfoĒ. It will look similar to the JPEG image above. I would like to have that information that has been entered on the User Form to be copied and attached to a separate Word docm, either through a linking method or by using a VBA method. From there I can link to different pages as I need, that I can do not a problem. Iím just having a problem getting information from a User Form to docm. The reason that Iím go to a User Form is because it has a better appearance than just a open docx.
    I hope I was able to explain a little better. Iím still learning the lingo and everything so I thank you for your patience.

  8. #8
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts
    [quote name='ababenchrist' post='788263' date='10-Aug-2009 15:05']I hope I was able to explain a little better. I'm still learning the lingo and everything so I thank you for your patience.[/quote]
    There is a very important piece of information that you have not yet supplied.

    If the macro is run a second time, does the userform have to be populated with information from the document?
    OR
    Does the Macro just have to run once for each document, and then it won't be run again?
    OR
    Does the Macro have to have blank (or default) values each time you run it again?

  9. #9
    3 Star Lounger
    Join Date
    Jun 2009
    Location
    Hemet CA
    Posts
    310
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='StuartR' post='788273' date='10-Aug-2009 07:38']There is a very important piece of information that you have not yet supplied.

    If the macro is run a second time, does the userform have to be populated with information from the document?
    OR
    Does the Macro just have to run once for each document, and then it won't be run again?
    OR
    Does the Macro have to have blank (or default) values each time you run it again?[/quote]

    Hi StuartR
    thats a good point thank you.
    each time the macro is run i would like it to refresh or update the existing document that it is attached too, with the new information that has been entered on the userform.
    is this what you are referring too.

  10. #10
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    The attachment to Post 259183 contains a Word 97-2003 template with a userform that is used to set document variables. The value of these document variables is displayed in the document by means of DocProperty fields (in the example, in the page header, but they could be in the body of the document too). I hope it works in Word 2007.

  11. #11
    3 Star Lounger
    Join Date
    Jun 2009
    Location
    Hemet CA
    Posts
    310
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post

    [quote name='HansV' post='788351' date='10-Aug-2009 16:15']The attachment to Post 259183 contains a Word 97-2003 template with a userform that is used to set document variables. The value of these document variables is displayed in the document by means of DocProperty fields (in the example, in the page header, but they could be in the body of the document too). I hope it works in Word 2007.[/quote]
    Thank you HansV
    I'll check it out.

Posting Permissions

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