Send HTML code to Internet Explorer from basic

vegaseat vegaseat is offline Offline Jan 6th, 2005, 8:52 pm |
0
New to me, but MS InternetExplorer does have COM support you can access from basic code. I had to test this out and make it work. We are using BCX basic, one of the successors to Qbasic.
Quick reply to this message  
Legacy and Other Languages Syntax
  1. ' add HTML code to InternetExplorer using COM support
  2. ' (you must have MS InternetExplorer installed on your computer)
  3. ' needs BCX basic ver 5.05.05 or later, download free package from:
  4. ' http://www.rjpcomputing.com/programming/bcx/devsuite.html
  5. ' COM credit goes to: Ljubisa Knezevic
  6.  
  7. BCX_SHOW_COM_ERRORS(TRUE)
  8.  
  9. dim H$ ' string H$ defaults to 2048 bytes
  10.  
  11. dim ie As Object
  12. set ie = createobject("InternetExplorer.Application")
  13.  
  14. ie.navigate "about:blank" ' do this first!
  15. ie.visible = true
  16. ie.height = 300
  17. ie.width = 550
  18. ie.menubar = false
  19. ie.toolbar = false
  20. ie.statusbar = false
  21. ie.resizable = true
  22.  
  23. ' build the HTML code string ...
  24. H$ = "<html><body><center><br><strong><font color=#A52A2A face="
  25. ' enc$() handles doublequotes within a string
  26. H$ = H$ + enc$("comic sans ms") +">"
  27. H$ = H$ + "-------- Church Bulletin Bloopers ---------"
  28. H$ = H$ + "</font></strong></center><br>"
  29. H$ = H$ + "Don't let worry kill you -- let the church help."
  30. H$ = H$ + "<br><br>"
  31. H$ = H$ + "Come hear missionary Bertha Beltsh all the way from Africa."
  32. H$ = H$ + "<br><br>"
  33. H$ = H$ + "For those of you who have children and don't know it, we have a nursery downstairs."
  34. H$ = H$ + "<br><br>"
  35. H$ = H$ + "This Sunday will be baptism in the South and North ends of the church. Children will be baptized at both ends."
  36. H$ = H$ + "<br><br>"
  37. H$ = H$ + "Miss Judson will sing "
  38. H$ = H$ + enc$("Put me in my little bed")
  39. H$ = H$ + " accompanied by the pastor."
  40. H$ = H$ + "<br><br>"
  41. H$ = H$ + "This Easter Sunday we will ask Mrs. Tugly to come forward and lay an egg on the altar."
  42. H$ = H$ + "<br><br>"
  43. H$ = H$ + "The ladies of the church have cast off clothing of every kind. They can be seen in the church basement Saturday."
  44. H$ = H$ + "<br><br>"
  45. H$ = H$ + "A bean supper will be held on Tuesday evening in the church hall. Music will follow."
  46. H$ = H$ + "<br><br>"
  47. H$ = H$ + "The Rev. Adams spoke briefly, much to the delight of his audience."
  48. H$ = H$ + "<br><br>"
  49. H$ = H$ + "The sermon this morning: Jesus Walks On Water."
  50. H$ = H$ + "<br><br>"
  51. H$ = H$ + "The sermon tonight: Searching For Jesus."
  52. H$ = H$ + "</body></html>"
  53.  
  54. ie.document.body.innerHTML = H$
  55.  
  56. Set ie = Nothing
  57.  

Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC