I hope I found the right place to post a question about creating a macro in Word.
What I want to know, is whether it is possible to create a macro which will delete all the characters between two specific words.
In short: I figured out how to find the words in the file by recording my actions when I used "ctrl+f". However, when I tried to record me deleting the characters inbetween, it turns out that I have to know how many characters there are to do that. In other words, the macro uses "Count". But I just want it to delete everything inbetween, no matter how many characters.
Id like to list my bookmarks from firefox in a word (2003) document. The steps Ive taken so far:
1) I saved all my bookmarks as a HTML-document
2) I opened the HTML-document and viewed the source code, which I copied and pasted in a word document
<DT><A HREF=" ADD_DATE="133475149" LAST_MODIFIED="133471649" ICON_URI="http://s.ytimg.com/yt/vicon-refresh-vfldLzJxy.ico" ICON="data:image/png;base64,iVBORw0KGgoAAAAAAAQCAYAAAAf8/9hAAABYklEQVQ4jcXTzUoCURjG8XdTnnN0Zs7Yh4JIVyAEXUm0DVp0AW26gILAFiWJFJrYwo9FErQxAoMsjJxoNhUDQbgecSPjJgYGnhaVTCO1aOMLv9Xz375EE797It7RwzUjKkxDF64RDeMvHT38/NnyMhERtXWevtPD+I+2ztPUksK80QX8bmMSdq2Ch6UUgptfSwqTmlL0r3QBv+uFOFzXxftggKf1NQT3b00p+tTQuHchBX5IxuE4DhzHwXA4xFupiMt4FMGuoXGPz2P9Ho9vBznxzspQHWNI+g0MY9utztitlrILKbGurrGQVWVeVWNw6+SmINlWbAsC2f7e9iYlcirDMGuqjKPSgrvn6gcfqXYDB4NA7sry9gUIRQD+6hTeJ8KKjcLKoffkcqxyqawHWEIbgEm5RSWPlQZ/iOniHhWYeWswswv+M2BEnoddRG2s0U0PdE/JCKiD2TAbGlHU6nxAAAAAElFTkSuQmCC">Robert Palmer - Johnny and Mary - YouTube</A>Of course this isnt what I was going for, as I want a list with the names of my bookmarks/urls and the corresponding urls. I can do this by just deleting all the unnecessary information, but this will take a lot of time. So I figured I should write a macro for it :D This is what I want it to do:
1) find at the end of the url the cursor is located
2) select everything between this and the following >
3) delete this whole selection (by pressing enter once)
4) find the following </A>
5) select everything between this </A> and the following HREF="
6) delete this whole selection (by pressing enter twice)
If I record my own movements while doing this in a word document, I just get
Selection.MoveRight Unit:=wdCharacter, Count:=922, Extend:=wdExtend
Has anybody got a clever idea for me? Basicaly, I wonder what the macro-language is for select everything between * and * .
Edited by hamluis, 27 April 2012 - 11:44 AM.
Edited for readability, moved from Programming to Business Applications - Hamluis.