-
I'm making an HTML editor for a company I'm working for, and I'm having trouble with a certain aspect of the reloading of the html files. My editor is for the laymen, I put several fields in it, such as the title, body, headers, etc. So it's not for people that know how to use HTML. What I need is a function that will split up the html file into these parts. Specifics aren't really needed, if someone can just get me some code I'm confident that I can modify it to suit my needs.
-
The basics for you then.
Find [HEAD] and [/HEAD] with instr.
Then use mid$ to return that part of the file.
Code:
Dim ipHead as Long
Dim ipHeadEnd as Long
Dim strHead as String
Dim iLength as Long
ipHead = instr(1, strHTMLFILE, "[HEAD]", vbTextCompare)
ipHeadEnd = instr(1, strHTMLFILE, "[/HEAD]", vbTextCompare)
iLength = len(ipheadEnd) + ipHeadEnd - ipHead
strHead = mid$(strHTMLFILE, ipHead, iLength)
I think that is right, though i haven't tested it.
-
html code is off, so you can use
<>
<head>
</head>