Is there a way to make a text in a textbox viewable in html without having to save it? if so will you show some sample code
Printable View
Is there a way to make a text in a textbox viewable in html without having to save it? if so will you show some sample code
viewable in HTML? do you mean put it into a browser? if so, add a webbrowser control or launch an instance of IE, and use the code below.
IE.Document.Body.InnerHTML = "your text goes here"
could i do this?
VB Code:
IE.Document.Body.InnerHTML = text1.text
Try it and see what happens. :)Quote:
Originally Posted by xypherx
my menu is giving variable not defined errors for some reason... and do i have to shell "iexplorer.exe" or what for it
I don't understand this comment. Are you running your "Text to HTML" thing from a menu?Quote:
Originally Posted by xypherx
If you are using a webbrowser control, that will take care of web browsing for you.Quote:
Originally Posted by xypherx
yes like you click on view and it drops down view in HTML, and would i have to have the browser shown on the form or would it open in a new window.
its not working for me...
Post the exact error you are getting and the section of code that it highlights when you get the error. Thanks :)
VB Code:
Private Sub html_Click() Shell "iexplorer.exe" IE.Document.Body.InnerHTML = Text1.Text End Sub
it gives the sub a yellow highlight, and it highlights the IE. in blue but see i dont know how to make this work right just trying.
can someone explain this to me.
That instance of IE has nothing to do with your code. You would have to create a web browser control in your program in order to assign your text to it.
how would i do that put a browser in my program and then what?
Here is one way. Once the page is loaded, you can grab the inner and outer html from it. If you don't have to actually see it, it is easier.
Here's a useful post :P.
What you need to do is click the Project menu in the VB IDE, then click on references. You're going to have a huge list of things with checkboxes on the left. Scroll to and check "Microsoft Internet Controls" in that list and click ok.
Then add this code in the approperiate place in your program.
VB Code:
Dim IE As InternetExplorer 'Browser object Set IE = New InternetExplorer 'Open a new internet explorer IE.Visible = True 'Make the browser visible IE.Navigate "about:_blank" 'Load a page in order to insert HTML into it. 'Loop until the browser is done loading the blank page While IE.ReadyState <> READYSTATE_COMPLETE DoEvents Wend 'Insert your html into the blank page IE.document.Body.InnerHTML = text1.text
Hopefully that doesn't give any errors. Ask if you need any more help.
im getting a runtime error. class does not support automation or does not support expected interface.
:S which line?
It ran perfectly fine when I tested it :S. I have IE 6 sp2 which may play a major role in this error because IE 6 sp2 has had so many stupid upgrades done to it that it no longer functions like the other browsers.
i also have ie 6 sp2 the line is.VB Code:
Set IE = New InternetExplorer 'Open a new internet explorer
did you reference the DLL or did you add it as a component?
I managed to produce the same error by adding the component. What you want to do is REFERENCE the DLL. Don't add the component. To reference the dll, it's right ontop of the COMPONENTS shortcut in that menu.
when i click internet controls it only gave me the browser.
I don't think you understand what I mean. Referencing a DLL and Adding a Control are not the same thing. I asked you to reference "Microsoft Internet Controls", but you add the control instead.
In the VB menues, click on
Project --> References
what you did was
*WRONG* Project --> Controls *WRONG*