| Skype: | TextControlSupport | |
| Orders: | 877-462-4772 |

| Author: | TX Text Control Support Department |
| Language: | VBScript |
| Version: | 1.0 |
| Released: | November 10, 2004 |
| Last modified: | January 11, 2008 |
| Requirements: | TX Text Control ActiveX with Internet Explorer 5.5 |
| Download code: | tx_sample_activex_msword.zip |

This sample application illustrates how to load binary files such as Microsoft Word documents into TX Text Control that is embedded in an HTML file.
Generally, you can use the Microsoft INET control to load documents into a variable. But it is not possible to load binary files such as Microsoft Word documents or the internal TX Text Control format.
Therefore, you can use the Microsoft XML Core Services (MSXML) to load a document using an HTTP GET command.
Function GetFile(URL) Dim objXML Dim HTTPResponse Set objXML = CreateObject("Msxml2.XMLHTTP") Call objXML.Open("GET", URL, False) Call objXML.Send() HTTPResponse = objXML.responseBody Set objXML = Nothing GetFile = HTTPResponse End Function
On a button, the GetFile() function is called with an URL as the parameter. The contents of the variable are used with TX Text Control's LoadFromMemory method.
Sub Button1_OnClick Dim objDocument objDocument = GetFile("http://bin.textcontrolasp.com/sample_load_msword/demo.doc") objTX.LoadFromMemory objDocument, 9, false End Sub
To run this sample application, you need to be using Microsoft Internet Explorer 5.5 or newer. Other browsers (such as Firefox and Opera) are not supported.
Launch Sample Application
The demo downloads 2MB of data, pls be patient.
To use the downloadable version of this sample at least a TX Text Control ActiveX 11.0 trial version, Internet Explorer 5.5 and MSXML2 are required.