Variable assignning

T

Thejan Mendis

HI all,


Can somebody tell me how do I assign a word document selection to a
variable.
It should be something like this

1/ first the macro I need to fine a XML tag. Then the it should select the
TEXT between the Open and closing tag.

2/ Selection assign to a variable

3/ the macro should run on all the .txt file in a given folder

I hope somebody can come out with a good example.


eg:-

<XML>
<TEXT>this is a test</TEXT>
<COL>blue</COL>


Dim txt = this is a test

PLEASE HELP ME ON THIS

TJ
 
B

Brian

1. selection.find (if you haven't used this before then record a
find/replace operation with the macro recorder)
2. here you could grab the text (i.e. selection.text) or get a reference to
the range object (selection.range)
3. Probably easiest to add a reference to Microsoft Scripting Runtime. This
will allow you loop through all file objects in a given folder object.

HTH

Brian


Thejan Mendis wrote in message ...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top