Results 1 to 4 of 4

Thread: need macro help

  1. #1
    New Lounger
    Join Date
    Nov 2016
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    need macro help

    You may have already covered how to do this in other posting. Iím not that familiar with VBA in Word
    I know Iím asking a lot for one macro but any help would be appreciated. Trying to stream line a word doc for those who donít comprehend basic word functions.
    Word version 2010
    I have a tabled doc that spans two pages. In this current doc I need to have a macro that will copy information from one set of tables on page one to page two tables. Most of the tables are locked down.
    It also need to be able to pull from a separate word doc (info doc) that also has tables a value from(cell 1) and put that value into cell 1 (current Doc). Then from there I need to pull from cell 2 (current Doc) its value and place it in cell 2 (info doc). Info doc needs to save this information and when Current doc is used again it needs to pull from the next cell down on Info Doc.
    I would also like to be able to have the macro save the current doc by the value in cell 2.
    The last function on the macro would be to have it print automatically.

  2. #2
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,054
    Thanks
    2
    Thanked 417 Times in 346 Posts
    Depending on the kinds of document's you're using, all of this could be done without macros. For example, the replication between tables could be done via formfields & cross-references if the document is suitable for use with 'filling in forms' protection. Similarly, the inter-document replication could be done via INCLUDETEXT fields & bookmarks if the source document will remain in the same folder and be accessible to the target documents.

    As you might gather from the above, we'd really need to know a lot more about your requirements before a particular solution could be settled upon.
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  3. #3
    New Lounger
    Join Date
    Nov 2016
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Good Morning MacropodCitation 160701 101 edit 161122A (1).docx
    here is the current doc we are working on. the end goal for this is to have a button on the doc it self that has the coding necessary to implement as much as possible what was described above. i Know basic functions on Word and the user of this template know a lot less than me. most are used to apps on a phone rather than a physical computer.
    the cell i was talking about in the above are cell 1 is the citation number cell 2 is the case number.

  4. #4
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,054
    Thanks
    2
    Thanked 417 Times in 346 Posts
    Your document contains mostly content controls but had you used formfields (which also makes the form usable on Macs), all the replications could be done with no macro coding at all. As it is, your reliance on bookmarks and cross-referencing makes the setup quite fragile and unreliable. For example, if the user tries to update the data by typing in the second table, those edits will never be reflected in the first one and, immediately you do something that causes the fields to refresh (e.g. printing the document), the edits will be lost. Furthermore, if you protect the content controls against deletion and protect the document, you'll find the content controls in the second table refusing to update.

    For your purposes, I'd suggest using formfields exclusively and, for the second table, a copy of the first one with the formfields in each cell replaced by a cross-reference to its counterpart in the first table. If you then check each formfield's 'calculate on exit' property and apply 'filling in forms' protection to the document, the second table will auto-update and you'll never need to worry about users trying to edit that one because it will be inaccesible.
    Cheers,

    Paul Edstein
    [MS MVP - Word]

Posting Permissions

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