who helps me with a script whats on this site

General Macro Scheduler discussion

Moderators: Dorian (MJT support), JRL

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

who helps me with a script whats on this site

Post by nachtegaal9999 » Mon Apr 24, 2006 11:46 pm

Hi ,

I have red the article on this website http://www.mjtnet.com/forum/viewtopic.php?t=1461

Because i am a beginner i have some diffeculties with this code in VB
I know this is a function but how do i use this function (this is new for me)

What's the vb code that extract text with the function below.
'll hope that someone (and maby the auther of it) show me how to do it with a simple example, it looks like very simple but for me it's not (i am a stupid?)
Who has the ability to do this for me and the thousends of all other users of this great program from Mjtnet.

I am a Hollander , or Dutchman transladed in English, I want to send you a send you 20 tulib bulbs in advandige from all the users, that have profit of this code.

Thanks a lot,
Simon from the Netherlands



'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(TagName,Num,all)
dim t
set 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: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Apr 25, 2006 6:54 am

Hi,

This function is part of this script:

http://www.mjtnet.com/forum/viewtopic.php?t=1461

It will only work in conjunction with this script. Then you can use it something like this:

VBRun>CreateIE
VBRun>Navigate,http://www.mjtnet.com/index.htm
Wait>1
VBEval>ExtractTag("P",2,0),result

The function is clearly documented in the comments above it. The above example extracts the text of the second "P" tag in the page.
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