Find and Replace VB Macros

K

kj

I have 1000+ Word documents that I need to make into Web pages. I am saving
the .doc as .htm but then I have to go into the .htm and make several
repetitive changes to meet my sites requirements and eliminate code generated
by Frontpage. I want to built a macro in Frontpage's VB to find HTML tags
and/or attributes and replace them. So far what I have been able to find
online has "issues". For example I want to remove class=MsoNormal within the
<p> tag (in a table) and find class=MsoTableWeb1 in the table tag and replace
it with class=panel.

On my wishlist items, if there is a way to do this task to all 1000 .htm
documents at one time, I would really be estatic.

Any ideas are greatly appreciated.
 
K

kj

I'm using 2003. Thank you, that is very helpful. That alone will save me a
lot of time. I have 4 search and replace to do for each file. Is there a
way to string them together?


I also need to find and replace links that vary in each of the files. In
the example below
src="Submit%20Response/image001.gif"

I want to find the data between src=" and /image that will be different
for each file and replace it wil /image.new so that the replaced now reads
src="/image.new/image001.gif"

Is there a way to search for varying data using the global search or do I
need VB for that?

Thanks in advance.
 
S

Stefan B Rusynko

You would just Search for: Submit%20Response/
and rep;ace with: /image.new/

PS
Do Not use a . in folder names as in "image.new"
- use an under_score or da-sh if you really need a separator for some reason
--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
_____________________________________________


| I'm using 2003. Thank you, that is very helpful. That alone will save me a
| lot of time. I have 4 search and replace to do for each file. Is there a
| way to string them together?
|
|
| I also need to find and replace links that vary in each of the files. In
| the example below
| src="Submit%20Response/image001.gif"
|
| I want to find the data between src=" and /image that will be different
| for each file and replace it wil /image.new so that the replaced now reads
| src="/image.new/image001.gif"
|
| Is there a way to search for varying data using the global search or do I
| need VB for that?
|
| Thanks in advance.
|
|
| "Steve Easton" wrote:
|
| > What version of FrontPage are you using?
| > If 2003 this is built in and is called global search and replace.
| >
| > Edit > Replace and check "All pages" and "Find in source code."
| >
| >
| > --
| >
| > Steve Easton
| > Microsoft MVP FrontPage
| > FP Cleaner
| > http://www.95isalive.com/fixes/fpclean.htm
| > Hit Me FP
| > http://www.95isalive.com/fixes/HitMeFP.htm
| >
| >
| >
| >
| > | > >I have 1000+ Word documents that I need to make into Web pages. I am saving
| > > the .doc as .htm but then I have to go into the .htm and make several
| > > repetitive changes to meet my sites requirements and eliminate code generated
| > > by Frontpage. I want to built a macro in Frontpage's VB to find HTML tags
| > > and/or attributes and replace them. So far what I have been able to find
| > > online has "issues". For example I want to remove class=MsoNormal within the
| > > <p> tag (in a table) and find class=MsoTableWeb1 in the table tag and replace
| > > it with class=panel.
| > >
| > > On my wishlist items, if there is a way to do this task to all 1000 .htm
| > > documents at one time, I would really be estatic.
| > >
| > > Any ideas are greatly appreciated.
| >
| >
| >
 

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