[AccessD] A2000: Inserting HTML codes into a Text Box

MartyConnelly martyconnelly at shaw.ca
Thu Apr 14 20:46:29 CDT 2005


How are you obtaining your news, here is a way I display a raw rss xml 
news feed in Access via new IE window
You may want to grab my xsl file that does the xslt transform to html  
from website and place on disk.

Of course it is a lot flashier and easier to grab a news feed with a 
special rss news reader.
especially when you can drag and drop the feed to your reader via "XML" 
feed icon.
There are a lot out there like this open source one
http://www.rssreader.com/

Sub BBCRSSFeed()
Dim srcTree As Object
Dim xsltTree As Object
Dim strHTML As String
 Set srcTree = CreateObject("Msxml.DOMDocument")
        srcTree.async = False
        srcTree.Load 
("http://news.bbc.co.uk/rss/newsonline_uk_edition/technology/rss091.xml")
 'srcTree.Load ("http://services.devx.com/outgoing/recentTipsFeed.xml")
 Set xsltTree = CreateObject("Msxml.DOMDOCUMENT")
        xsltTree.async = False
        'this xsl transform file can also be loaded via a local disk file
        xsltTree.Load ("http://www5.brinkster.com/mconnelly/newsfeed.xsl")

        strHTML = srcTree.transformNode(xsltTree)
        Debug.Print strHTML
        ' Display transformed xml rss news feed in html via IE 6.0 window
        testIE (strHTML)      
End Sub

Sub testIE(strpassHTML As String)
'------------------

Dim objExplorer As Object
Dim objDocument As Object
Dim strComputer As String

Dim strReturn As String

Set objExplorer = CreateObject("InternetExplorer.Application")

objExplorer.Navigate "about:blank"
objExplorer.Toolbar = 0
objExplorer.StatusBar = 0
objExplorer.Width = 800
objExplorer.Height = 570
objExplorer.Left = 0
objExplorer.Top = 0
objExplorer.Visible = 1
'dont't need to navigate to file or http site
'just drop html string in document object
'objExplorer.Navigate "http://checkip.dyndns.org/"
Do While (objExplorer.Busy)
Loop
Dim webtx As String
Dim strHTML As String
Set objDocument = objExplorer.Document
objDocument.Open
objDocument.Writeln "<html><head><title>My BBC Technology RSS 
Feed</title></head>"
objDocument.Writeln "<body bgcolor='red';" & _
    " {   background-attachment: fixed; background-position: 97% bottom; 
" & _
      "  background-image= 'url(logoBackGround.gif)';background-repeat: 
no-repeat;" & _
       " padding: 5px;font-family='Georgia';font-size: 80%;} >" 
     ' if no gif file it should execute okay.
objDocument.Writeln "<table width='100%'>"
objDocument.Writeln "<tr>"
objDocument.Writeln "<td width='20%'><b>BBC Feed</b></td>"
objDocument.Writeln "</tr>"
objDocument.Writeln "</table>"
objDocument.Writeln strpassHTML
objDocument.Writeln "</body></html>"
objDocument.Close
'MsgBox "finished"
Set objExplorer = Nothing
Set objDocument = Nothing
End Sub


Steve Erbach wrote:

>Charlotte,
>
>Perhaps that's it, then, at least in Access 2000. OK, I'll try another way.
>
>Steve Erbach
>
>On 4/14/05, Charlotte Foust <cfoust at infostatsystems.com> wrote:
>  
>
>>Hmmn.  You failed to mention the ADP previously, and there are definite
>>differences between ADPs and MDBs.  I have no idea whether AutoKeys
>>works in ADPs or not, so in an ADP, I would probably opt for one of the
>>alternative approaches suggested.
>>
>>Charlotte Foust
>>
>>    
>>

-- 
Marty Connelly
Victoria, B.C.
Canada






More information about the AccessD mailing list