Page 1 of 1

Searching using data from clipboard (Macro)

Posted: Tue May 23, 2006 9:32 pm
by Raulm
Hi all,
I have been very impressed with the expertise found in this forum.

I have a question. I hope someone can help me.

I am trying to write a macro that is capable of pasting variable data (the content of the clipboard) into the search command.

For example:
in document 1 I will have:

John Martin | Licence# 12345|
Karl Michael | Licence# 3456657|
Jane Smith | Licence # 656789|
.
.
.

In document 2 I will have:

Member name: #12345 - status: paid - gender : male - age 24
Member name: #3456657 - status: owing - gender: male - age 56
Member name: #656789 - status: owing - gender: female - age 27
.
.
.

I would like to be able to
-search sequentially in doc 1 for a licence # (e.g. 12345),
-copy the name correspoding to licence 12345 (John Martin).
- go to document 2 and do a search for the string 12345
- replace the word "Member name" for the content of the clipboard (John Martin)

In the end, my document 2 would look like this:

John Martin: #12345 - status: paid - gender : male - age 24
Karl Michael: #3456657 - status: owing - gender: male - age 56
Jane Smith: #656789 - status: owing - gender: female - age 27

Thanks for any help you could lend me.

Regards,

Raoul

Posted: Fri May 26, 2006 8:50 am
by MichaelD
Hi!

I think this could be done mor easily using Excel or Access

Greets,
Michael D

Posted: Fri May 26, 2006 1:24 pm
by talleyrand
I believe openoffice.org also has a free version of an Access-like database. What you are looking to do is import your two text files into tables and then do a query where you join together on the license number.

Posted: Fri May 26, 2006 2:41 pm
by Bob Hansen
TextPad macros do not handle dynamic copy/paste. When you record a macro that does that, the values become hardcoded in the macro so the next time you run, you will not be doing any real time copy/paste.

This could be done with a tool like Macro Scheduler or with a database as mentioned in previous posting

Posted: Fri May 26, 2006 3:23 pm
by Raulm
Thank you guys!
I appreciate your feedback.

Good luck!

Bob Hansen: that picture of you looks interesting!

Posted: Fri May 26, 2006 4:36 pm
by Bob Hansen
Makes my momma proud!