PDA

View Full Version : Passing variables between open documents



lkpederson
03-24-2014, 12:21 PM
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.

SamT
03-24-2014, 01:45 PM
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

lkpederson
03-24-2014, 04:50 PM
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.

fumei
03-24-2014, 06:28 PM
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?

SamT
03-24-2014, 09:45 PM
Must know how to find "references":

Paragraph number?
After certain Word?
BookMark?
Table and column and row?