Custom VBScript Code - Access web pages within a script (kb2650)

The information in this article applies to:

  • SwyxWare from version 4

[ Summary | Information | Links ]


Using some VBScript statements it is possible to access information from a website. In this example a website from Yahoo is checked for each incomming call and the latest Exchange rate Dollar-Euro is retrieved. Then this information is announced.


Access web pages within a script

Microsoft offers a modul called "Msxml2.ServerXMLHTTP.3.0". It gives an easy access to web pages. "Msxml2.ServerXMLHTTP.3.0" is contained in Windows 2000, 2003 and XP, there is no need for a separate installation. 

The function dollar()must be written in the Start-Block of your GSE-Script in the field "User Script" in the TAB "Parameters":


  1. Function dollar()
  2.     Dim http_req, pos
  3.     http_req = CreateObject("Msxml2.ServerXMLHTTP.3.0")
  4."GET", "", False)
  5.     http_req.send()
  6.     pos = instr(http_req.responseText, "Letzter Kurs")
  7.     dollar = mid(http_req.responseText, pos + 54, 6)
  8. End Function


This function opens the appropriate webpage of Yahoo, which contains the latest exchange rate between Dollar and Euro. The complete webpage can be found after the send method in the variable http_req.responseText. After extracting the exchange rate, it will be assinged to the return value of the function.

Using this function can be done for example in a Block "Say Number" by entering


in the field "String of digits" at the parameters of the block. The annuncemen will just say the digits, not the decimal point, e.g. 1.2056 will be announced as 1 2 0 5 6.


Hint 1: There are more examples of VB Script Code at:

Hint 2: If you use a HTTP proxy server in your network, please ensure that the user account used by the SwyxWare server service to log on, has the appropriate HTTP proxy settings. Otherwise HTTP request will fail with an error message.

This can be configured with the Microsoft Tool PROXY.CFG. Details can be found at:


For simply calling a webpage without evaluating its content, you can also use the following function which is provided in the Swyx Forum:


As far as software supplied or used by us, includes open source elements the additional terms under apply in addition. An overview which products from the Swyx portfolio include open source elements and which open source license is relevant can be found under

The third-party contact information included in this article is provided to help you find the technical support you need. This contact information is subject to change without notice. Swyx in no way guarantees the accuracy of this third-party contact information nor is responsible for it's content.


Comment on this article

If we have any follow-up questions, where can we contact you?

E-Mail Address (optional)


This feedback form can't be used for support requests. Those requests must be directed to your Swyx reseller or distributor.