Paddling Ghost
Paddling Ghost

Reputation: 135

How can I add html into VBA?

I'm trying to parse through some HTML code that I'd like to paste into my VBA function. Essentially, i want to dim a string and then let the string = [INSERT HTML HERE]. Except if i tried to do that VBA would pick up on quotation marks and other symbols as VBA code and then give me a compile error of some sort.

I would parse the html first and either add quotation marks wherever i find a quotation mark or exit out all the symbols, but that would require pasting the html into a compiler that will have the same problem as before. I really can't figure this out!

What can be done about this? Is there a way for me to modify my regex pattern to automatically exit out the symbols? I'm really at a loss. I had one idea, but i can't figure out how to do this either. If i could say string=[FILE CONTAINING HTML] then that would work as well. any suggestions please.

Upvotes: 0

Views: 697

Answers (1)

Nick.Mc
Nick.Mc

Reputation: 19194

Just open the HTML file and read it into a string variable. Here's an example.

http://www.vbforums.com/showthread.php?342619-Classic-VB-How-can-I-read-write-a-text-file

Upvotes: 1

Related Questions