found script on this website

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
nachtegaal9999
Newbie
Posts: 8
Joined: Sun Apr 09, 2006 10:40 pm

found script on this website

Post by nachtegaal9999 » Fri Apr 21, 2006 11:13 pm

Hi,

I have found a vb script on this website but i don't know how to handle this, it is very simple but i don't.

I want to have a tag on a html page in a textbox.

Who wants to help me with this?

Thanks in advance
Greetings
Simon From the Netherlands


the script on this website:

'This function extracts text from a specific tag by name and index
'e.g. TABLE,0 (1st Table element) or P,1 (2nd Paragraph element)
'set all to 1 to extract all HTML, 0 for only inside text without HTML
Function ExtractTag(ByVal TagName, ByVal Num, ByVal all)
Dim t
t = IE.document.getElementsbyTagname(TagName)
If all = 1 Then
ExtractTag = t.Item(Num).outerHTML
Else
ExtractTag = t.Item(Num).innerText
End If
End Function

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Apr 25, 2006 7:06 am

Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts