PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
Text to HTML-VBForums
Results 1 to 21 of 21

Thread: Text to HTML

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2005
    Posts
    348

    Text to HTML

    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

  2. #2
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    879

    Re: Text to HTML

    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"
    Visual Basic 6.0
    Visual C++ 5
    Delphi 5


  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2005
    Posts
    348

    Re: Text to HTML

    could i do this?
    VB Code:
    1. IE.Document.Body.InnerHTML = text1.text

  4. #4
    Super Moderator Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,335

    Re: Text to HTML

    Quote Originally Posted by xypherx
    could i do this?
    VB Code:
    1. IE.Document.Body.InnerHTML = text1.text
    Try it and see what happens.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    When you have received an answer to your question, please mark it as resolved using the Thread Tools menu.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    I dont answer coding questions via PM or EMail. Please post a thread in the appropriate forum section.

    Creating A Wizard In VB.NET
    Paging A Recordset
    What is wrong with using On Error Resume Next
    Good Article: Language Enhancements In Visual Basic 2010
    Upgrading VB6 Code To VB.NET
    Microsoft MVP 2005/2006/2007/2008/2009/2010/2011/2012/Defrocked

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2005
    Posts
    348

    Re: Text to HTML

    my menu is giving variable not defined errors for some reason... and do i have to shell "iexplorer.exe" or what for it

  6. #6
    Super Moderator Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,335

    Re: Text to HTML

    Quote Originally Posted by xypherx
    my menu is giving variable not defined errors for some reason...
    I don't understand this comment. Are you running your "Text to HTML" thing from a menu?
    Quote Originally Posted by xypherx
    and do i have to shell "iexplorer.exe" or what for it
    If you are using a webbrowser control, that will take care of web browsing for you.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    When you have received an answer to your question, please mark it as resolved using the Thread Tools menu.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    I dont answer coding questions via PM or EMail. Please post a thread in the appropriate forum section.

    Creating A Wizard In VB.NET
    Paging A Recordset
    What is wrong with using On Error Resume Next
    Good Article: Language Enhancements In Visual Basic 2010
    Upgrading VB6 Code To VB.NET
    Microsoft MVP 2005/2006/2007/2008/2009/2010/2011/2012/Defrocked

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2005
    Posts
    348

    Re: Text to HTML

    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.

  8. #8

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2005
    Posts
    348

    Re: Text to HTML

    its not working for me...

  9. #9
    No place like 127.0.0.1 eyeRmonkey's Avatar
    Join Date
    Jul 2005
    Location
    Blissful Oblivion
    Posts
    2,306

    Re: Text to HTML

    Post the exact error you are getting and the section of code that it highlights when you get the error. Thanks
    Visual Studio 2005 Professional Edition (.NET Framework 2.0)
    ~ VB .NET Links: Visual Basic 6 to .NET Function Equivalents (Thread) | Refactor! (White Paper) | Easy Control for Wizard Forms | Making A Proper UI For WinForms | Graphics & GDI+ Tutorial | Websites For Free Icons
    ~ QUOTE: Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rich Cook

    ~ eyeRmonkey.com

  10. #10

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2005
    Posts
    348

    Re: Text to HTML

    VB Code:
    1. Private Sub html_Click()
    2. Shell "iexplorer.exe"
    3. IE.Document.Body.InnerHTML = Text1.Text
    4. 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.

  11. #11

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2005
    Posts
    348

    Re: Text to HTML

    can someone explain this to me.

  12. #12
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Text to HTML

    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.

  13. #13

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2005
    Posts
    348

    Re: Text to HTML

    how would i do that put a browser in my program and then what?

  14. #14
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Text to HTML

    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.
    Attached Files Attached Files

  15. #15
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    879

    Re: Text to HTML

    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:
    1. Dim IE As InternetExplorer    'Browser object
    2.  
    3.   Set IE = New InternetExplorer 'Open a new internet explorer
    4.   IE.Visible = True 'Make the browser visible
    5.  
    6.   IE.Navigate "about:_blank" 'Load a page in order to insert HTML into it.
    7.  
    8.   'Loop until the browser is done loading the blank page
    9.   While IE.ReadyState <> READYSTATE_COMPLETE
    10.     DoEvents
    11.   Wend
    12.  
    13.   'Insert your html into the blank page
    14.   IE.document.Body.InnerHTML = text1.text

    Hopefully that doesn't give any errors. Ask if you need any more help.
    Visual Basic 6.0
    Visual C++ 5
    Delphi 5


  16. #16

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2005
    Posts
    348

    Re: Text to HTML

    im getting a runtime error. class does not support automation or does not support expected interface.

  17. #17
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    879

    Re: Text to HTML

    :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.
    Visual Basic 6.0
    Visual C++ 5
    Delphi 5


  18. #18

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2005
    Posts
    348

    Re: Text to HTML

    i also have ie 6 sp2 the line is.
    VB Code:
    1. Set IE = New InternetExplorer 'Open a new internet explorer

  19. #19
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    879

    Re: Text to HTML

    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.
    Visual Basic 6.0
    Visual C++ 5
    Delphi 5


  20. #20

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2005
    Posts
    348

    Re: Text to HTML

    when i click internet controls it only gave me the browser.

  21. #21
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    879

    Re: Text to HTML

    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*
    Visual Basic 6.0
    Visual C++ 5
    Delphi 5


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width