Consulting

Results 1 to 5 of 5

Thread: Passing variables between open documents

  1. #1

    Passing variables between open documents

    Here is the project:
    1. Open a document
    2. extract references (come in the form of "A354.1-09, C-1.1.1, 28CFR340.2, etc.). No real pattern.
    3. Copy references to another document
    4. Close document
    5. Open another document
    6. extract references
    7. check other document to see if they're there already
    8. If not, append
    9. Close document
    10. wash, rinse, repeat

    Where I'm having trouble:
    Passing the variable value (the reference) from the Active document to the "other document". If I use:
    Selection = MyRef, it pastes MyRef into the "other document". I'm sure the solution is simple.

    Oh and no, I don't do this for a living.

  2. #2
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    Let me see if I can restate your post using better programming terms

    Here is the project:
    1. Open a document (Doc1)
    2. Paste Certain Values to another document (Doc2)
    3. Close document (Doc1)
    4. Open another document (Doc3)
    5 Examine Certain Values in Doc3
    6. check other document (Doc2?) to see if they're there already
    7 If not, Copy into Doc2 from Doc3)
    8. Close document (Doc3?)
    9. wash, rinse, repeat with (Doc2 & Doc4?)

    That is my best guess at what you want to say. As you can see there are several facts that need to be clarified
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  3. #3
    Here is the project:
    1. Open a document (doc1)
    2. extract references (come in the form of "A354.1-09, C-1.1.1, 28CFR340.2, etc.). No real pattern.
    3. Copy references to another document (doc end)
    4. Close document (doc1)
    5. Open another document (doc2)
    6. extract references (doc2)
    7. check other document to see if they're there already (doc end)
    8. If not, append (from doc2 to doc end)
    9. Close document (doc 2)
    10. wash, rinse, repeat (doc(n) where n = 1-X), X being total number of documents in a directory.

  4. #4
    VBAX Wizard
    Joined
    May 2004
    Posts
    6,713
    Location
    What does "extract" mean? I understand you are copying to another document, but does "extract" mean the original is deleted?

    What does "reference" mean? Are they all strings (like "A354.1-09")? These are not really references, at least not as far as Word is concerned. Do you have a list?

  5. #5
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    Must know how to find "references":

    Paragraph number?
    After certain Word?
    BookMark?
    Table and column and row?
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

Posting Permissions

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