A problem: VB6 app which needs to edit HTML tags 
Author Message
 A problem: VB6 app which needs to edit HTML tags

I'm developing a file management app using VB6, and I have a problem.  I
would be extremely grateful if anybody could point me in the direction
of a solution.  I don't ask anybody to do my job for me - I just want a
clue!  If I have posted this to any newsgroup in which it is
inappropriate, please accept my apologies.

My app needs to be able to insert, edit and delete HTML tags in .HTM
files originating from FrontPage.  I've written code which does this
using Binary I/O, and it works, but my problem is this: the only way I
can see of removing an unwanted tag is to overwrite it with spaces,
which means that the file gets longer and more padded with unnecessary
spaces each time my app edits it.  This is obviously not good!  I want
to avoid having to read in the whole content of the file in order to
edit it, as some of them will be very large and the whole thing will get
(even) slower.

Does anybody know of a way in which I can insert/delete characters in an
HTM file using VB6 without incurring this problem?  Many thanks in
anticipation,

--
Bruce Walton
IT Consultant



Sun, 17 Aug 2003 19:41:06 GMT  
 A problem: VB6 app which needs to edit HTML tags
I don't see how you can not process the entire file if you are looking for
specific tags. You can use the FileSystemObject to process the file and read
it in a line at a time. When you find the tag in question use the replace
function to get rid of or change the tag.

John

Quote:

> I'm developing a file management app using VB6, and I have a problem.  I
> would be extremely grateful if anybody could point me in the direction
> of a solution.  I don't ask anybody to do my job for me - I just want a
> clue!  If I have posted this to any newsgroup in which it is
> inappropriate, please accept my apologies.

> My app needs to be able to insert, edit and delete HTML tags in .HTM
> files originating from FrontPage.  I've written code which does this
> using Binary I/O, and it works, but my problem is this: the only way I
> can see of removing an unwanted tag is to overwrite it with spaces,
> which means that the file gets longer and more padded with unnecessary
> spaces each time my app edits it.  This is obviously not good!  I want
> to avoid having to read in the whole content of the file in order to
> edit it, as some of them will be very large and the whole thing will get
> (even) slower.

> Does anybody know of a way in which I can insert/delete characters in an
> HTM file using VB6 without incurring this problem?  Many thanks in
> anticipation,

> --
> Bruce Walton
> IT Consultant




Sun, 17 Aug 2003 23:54:38 GMT  
 A problem: VB6 app which needs to edit HTML tags
Replace("my html string ", "<tag I want to delete>", "")


Quote:

> I'm developing a file management app using VB6, and I have a problem.  I
> would be extremely grateful if anybody could point me in the direction
> of a solution.  I don't ask anybody to do my job for me - I just want a
> clue!  If I have posted this to any newsgroup in which it is
> inappropriate, please accept my apologies.

> My app needs to be able to insert, edit and delete HTML tags in .HTM
> files originating from FrontPage.  I've written code which does this
> using Binary I/O, and it works, but my problem is this: the only way I
> can see of removing an unwanted tag is to overwrite it with spaces,
> which means that the file gets longer and more padded with unnecessary
> spaces each time my app edits it.  This is obviously not good!  I want
> to avoid having to read in the whole content of the file in order to
> edit it, as some of them will be very large and the whole thing will get
> (even) slower.

> Does anybody know of a way in which I can insert/delete characters in an
> HTM file using VB6 without incurring this problem?  Many thanks in
> anticipation,

> --
> Bruce Walton
> IT Consultant




Mon, 18 Aug 2003 04:26:32 GMT  
 A problem: VB6 app which needs to edit HTML tags
Try something like this

Dim strNull
strNull = Empty
Dim strSomething
strSomething = "hello"
newString = Replace(strSomething, "e", strNull)
MsgBox newString

Using the empty keyword makes sure that variable is empty, actually all
variables that are DIM'med begin empty so it should not be needed to
explicitely declare it empty, but it is always better to make sure.

HTH

B.P.
http://www.ispelunker.com/


Quote:

> I'm developing a file management app using VB6, and I have a problem.  I
> would be extremely grateful if anybody could point me in the direction
> of a solution.  I don't ask anybody to do my job for me - I just want a
> clue!  If I have posted this to any newsgroup in which it is
> inappropriate, please accept my apologies.

> My app needs to be able to insert, edit and delete HTML tags in .HTM
> files originating from FrontPage.  I've written code which does this
> using Binary I/O, and it works, but my problem is this: the only way I
> can see of removing an unwanted tag is to overwrite it with spaces,
> which means that the file gets longer and more padded with unnecessary
> spaces each time my app edits it.  This is obviously not good!  I want
> to avoid having to read in the whole content of the file in order to
> edit it, as some of them will be very large and the whole thing will get
> (even) slower.

> Does anybody know of a way in which I can insert/delete characters in an
> HTM file using VB6 without incurring this problem?  Many thanks in
> anticipation,

> --
> Bruce Walton
> IT Consultant




Mon, 18 Aug 2003 07:45:39 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. A problem: VB6 app which needs to edit HTML tags

2. How to extract html tags using vb6????

3. Converting HTML tags to Word tags

4. I need HTML tags in a textbox dynamically filled

5. Reading META tags from a VB6 App

6. Need Simple ActiveX control for HTML Editing

7. Need html edit control

8. Problem installing new vbnet app on a computer with vb6 app

9. Need help with Masked Edit Control VB6...

10. I need to POST an HTML form to more than one app

11. Need HTML App Help

12. How do I edit an ID3 Tag?

 

 
Powered by phpBB® Forum Software