Gday,

Ive got a string that contains a whole bunch of HTML tags - the values of
which I need to change.
For some reason the document contains a whole bunch of '<FONT SIZE=2>', I
need to search and replace all these instances with my own string value
which would be '<FONT SIZE=3><FONT TYPE=arial>'

Is there some way to do a search and replace in VB without resorting to VBA?
(I cant use VBA because this piece of code is running on a server that
doesnt have office installed.)

Thanks,
Grant

Re: String manipulation by Al

Al
Thu Apr 29 06:34:03 CDT 2004


"Grant" <gpsnett@hotmail.com> wrote in message news:udmdo0dLEHA.2704@TK2MSFTNGP10.phx.gbl...
> Gday,
>
> Ive got a string that contains a whole bunch of HTML tags - the values of
> which I need to change.
> For some reason the document contains a whole bunch of '<FONT SIZE=2>', I
> need to search and replace all these instances with my own string value
> which would be '<FONT SIZE=3><FONT TYPE=arial>'

strHTML = Replace(strHTML,"<FONT SIZE=2>","<FONT SIZE=3><FONT TYPE=arial>",,,vbTextCompare)

>
> Is there some way to do a search and replace in VB without resorting to VBA?
> (I cant use VBA because this piece of code is running on a server that
> doesnt have office installed.)
>

?

> Thanks,
> Grant
>
>



Re: String manipulation by NickHK

NickHK
Thu Apr 29 21:53:53 CDT 2004

Grant,
The Replace function.

NickHK

"Grant" <gpsnett@hotmail.com> wrote in message
news:udmdo0dLEHA.2704@TK2MSFTNGP10.phx.gbl...
> Gday,
>
> Ive got a string that contains a whole bunch of HTML tags - the values of
> which I need to change.
> For some reason the document contains a whole bunch of '<FONT SIZE=2>', I
> need to search and replace all these instances with my own string value
> which would be '<FONT SIZE=3><FONT TYPE=arial>'
>
> Is there some way to do a search and replace in VB without resorting to
VBA?
> (I cant use VBA because this piece of code is running on a server that
> doesnt have office installed.)
>
> Thanks,
> Grant
>
>



Re: String manipulation by Bob

Bob
Thu Apr 29 07:05:58 CDT 2004

"Al Reid" <areidjr@reidDASHhome.com> wrote in message
news:eLiMi4dLEHA.128@TK2MSFTNGP09.phx.gbl
> "Grant" <gpsnett@hotmail.com> wrote in message
> news:udmdo0dLEHA.2704@TK2MSFTNGP10.phx.gbl...
>> Gday,
>>
>> Ive got a string that contains a whole bunch of HTML tags - the
>> values of which I need to change.
>> For some reason the document contains a whole bunch of '<FONT
>> SIZE=2>', I need to search and replace all these instances with my
>> own string value which would be '<FONT SIZE=3><FONT TYPE=arial>'
>
> strHTML = Replace(strHTML,"<FONT SIZE=2>","<FONT SIZE=3><FONT
> TYPE=arial>",,,vbTextCompare)

adding another font tag will unbalance the </font> tags

I think it can be done as:
<FONT SIZE=3 TYPE=arial>

--
Reply to the group so all can participate
VB.Net... just say "No"


Re: String manipulation by Grant

Grant
Thu Apr 29 07:16:09 CDT 2004

Geez I feel like an idiot - I should have searched for that on msdn.

Thanks for your help!

"Bob Butler" <tiredofit@nospam.com> wrote in message
news:eVqpWJeLEHA.2244@tk2msftngp13.phx.gbl...
> "Al Reid" <areidjr@reidDASHhome.com> wrote in message
> news:eLiMi4dLEHA.128@TK2MSFTNGP09.phx.gbl
>> "Grant" <gpsnett@hotmail.com> wrote in message
>> news:udmdo0dLEHA.2704@TK2MSFTNGP10.phx.gbl...
>>> Gday,
>>>
>>> Ive got a string that contains a whole bunch of HTML tags - the
>>> values of which I need to change.
>>> For some reason the document contains a whole bunch of '<FONT
>>> SIZE=2>', I need to search and replace all these instances with my
>>> own string value which would be '<FONT SIZE=3><FONT TYPE=arial>'
>>
>> strHTML = Replace(strHTML,"<FONT SIZE=2>","<FONT SIZE=3><FONT
>> TYPE=arial>",,,vbTextCompare)
>
> adding another font tag will unbalance the </font> tags
>
> I think it can be done as:
> <FONT SIZE=3 TYPE=arial>
>
> --
> Reply to the group so all can participate
> VB.Net... just say "No"
>



Re: String manipulation by Al

Al
Thu Apr 29 07:29:26 CDT 2004

Bob,

You are correct. I guess I just didn't think it through.

--
Al Reid

"It ain't what you don't know that gets you into trouble. It's what you know
for sure that just ain't so." --- Mark Twain

"Bob Butler" <tiredofit@nospam.com> wrote in message news:eVqpWJeLEHA.2244@tk2msftngp13.phx.gbl...
> "Al Reid" <areidjr@reidDASHhome.com> wrote in message
> news:eLiMi4dLEHA.128@TK2MSFTNGP09.phx.gbl
> > "Grant" <gpsnett@hotmail.com> wrote in message
> > news:udmdo0dLEHA.2704@TK2MSFTNGP10.phx.gbl...
> >> Gday,
> >>
> >> Ive got a string that contains a whole bunch of HTML tags - the
> >> values of which I need to change.
> >> For some reason the document contains a whole bunch of '<FONT
> >> SIZE=2>', I need to search and replace all these instances with my
> >> own string value which would be '<FONT SIZE=3><FONT TYPE=arial>'
> >
> > strHTML = Replace(strHTML,"<FONT SIZE=2>","<FONT SIZE=3><FONT
> > TYPE=arial>",,,vbTextCompare)
>
> adding another font tag will unbalance the </font> tags
>
> I think it can be done as:
> <FONT SIZE=3 TYPE=arial>
>
> --
> Reply to the group so all can participate
> VB.Net... just say "No"
>



Re: String manipulation by Jeff

Jeff
Thu Apr 29 07:47:33 CDT 2004


"Bob Butler" <tiredofit@nospam.com> wrote in message
news:eVqpWJeLEHA.2244@tk2msftngp13.phx.gbl...

> I think it can be done as:
> <FONT SIZE=3 TYPE=arial>

And I believe the attribute is "face," not "type."



Re: String manipulation by Bob

Bob
Thu Apr 29 08:25:15 CDT 2004

"Jeff Johnson [MVP: VB]" <i.get@enough.spam> wrote in message
news:epczngeLEHA.4080@TK2MSFTNGP12.phx.gbl
> "Bob Butler" <tiredofit@nospam.com> wrote in message
> news:eVqpWJeLEHA.2244@tk2msftngp13.phx.gbl...
>
>> I think it can be done as:
>> <FONT SIZE=3 TYPE=arial>
>
> And I believe the attribute is "face," not "type."

I thought something looked wrong about it but it was 5AM and I wasn't quite
awake yet and I coudn't remmebr if it was face or style or something along
those lines! (had to call in to work to fix a problem and while I was
waiting for that I scanned the groups -- sick, I know, but at least I did
have a valid reason to be connected at that time <g>)

BTW, here's an interesting little rant on the use of font:
http://www.mcsr.olemiss.edu/~mudws/font.html

--
Reply to the group so all can participate
VB.Net... just say "No"


Re: String manipulation by Jeff

Jeff
Thu Apr 29 09:39:47 CDT 2004


"Bob Butler" <tiredofit@nospam.com> wrote in message
news:uWOFr1eLEHA.1312@TK2MSFTNGP12.phx.gbl...

> BTW, here's an interesting little rant on the use of font:
> http://www.mcsr.olemiss.edu/~mudws/font.html

Oh, absolutely. FONT sucks. I've known for a long time that its use is
discouraged.