Results 1 to 10 of 10

Thread: [RESOLVED] [Word/VBA] Writing HTML to TextBox

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2008
    Posts
    267

    Resolved [RESOLVED] [Word/VBA] Writing HTML to TextBox

    i have a textbox that shows the content of a certain website.
    i fill the textbox with:

    Code:
    TextBox30.Text = objDocument.documentElement.innerText
    objDocument.documentElement.innerHTML will show the text in HTML. but can Textbox translate that HTML code a show the website with all the correct layout/colors from the HTML?

    Thanks in advanced
    Last edited by Amien; Jun 16th, 2008 at 08:39 AM.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: [Word/VBA] Writing HTML to TextBox

    I don't understand what you mean by "translate" - what do you want to do with the textboxs content? Do you want to actually display the page?

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2008
    Posts
    267

    Re: [Word/VBA] Writing HTML to TextBox

    Yes .. i want to see the same as it would be in IE/FireFox.. same look, only in TextBox

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: [Word/VBA] Writing HTML to TextBox

    You can't display a web page in a textbox.

    In order for the page to be created, the code behind it, which is now in your textbox, needs to execute.

    The only thing the code in your textbox is going to do is sit there in your textbox being straight text.

    What is the purpose for this? Perhaps some kind of work around can be arrived at.

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2008
    Posts
    267

    Re: [Word/VBA] Writing HTML to TextBox

    In Visual Studio i would use the WebBrowser1 Control. VBA doesnt have that option

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2008
    Posts
    267

    Re: [Word/VBA] Writing HTML to TextBox

    The purpose of that the html written in the textbox as text is a bit messed up .. the webpage in html has more structure and more easy to read.
    the html that i'm getting is not some fancy website with flash etc. Its a normal website, with just some colors and breaklines.

  7. #7
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: [Word/VBA] Writing HTML to TextBox

    Quote Originally Posted by Amien
    In Visual Studio i would use the WebBrowser1 Control. VBA doesnt have that option
    VBA has that option

    To put a Webbrowser control on a userform, right click the Control Toolbox and select Additional Controls

    Scroll down to Microsoft Web Browser and put a check next to it.

    Then you can drag the control onto your userform and control it just like an instance of InternetExplorer.

    Hope this helps....
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

  8. #8

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2008
    Posts
    267

    Re: [Word/VBA] Writing HTML to TextBox

    Quote Originally Posted by koolsid
    Hope this helps....
    Alot .. tnx .. works fine

  9. #9

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2008
    Posts
    267

    Re: [RESOLVED] [Word/VBA] Writing HTML to TextBox

    bit surprised that it has the option .. VBA more powerful than i thought

  10. #10

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2008
    Posts
    267

    Re: [RESOLVED] [Word/VBA] Writing HTML to TextBox

    btw .. the website is in a string. How can i sent that string to WebBrowser1?
    dont wanna use Webbrowser1.Navigate("www.website.com")

Posting Permissions

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



Click Here to Expand Forum to Full Width