MSWORD

Purpose:

Writes a string to MS Word using ActiveX

Syntax:

MSWORD("text")

"text"

-

Optional. A string to insert into the Word document.

Returns:

Nothing. Starts MS Word and inserts the string.

Example:

msword("This is some text.")

 

DADiSP starts MS Word and inserts the string

 

This is some text.

 

into the new document.

Remarks:

MSWORD is a simple example of how to invoke an external application (MS Word) as an ActiveX server using SPL.

 

SPL uses an ActiveX syntax similar to C/C++ and Visual Basic.

 

Here are the pertinent SPL statements:

 

word = CreateObject("Word.Application"); // start Word
doc = word.Documents;                    // get Doc object
range = doc.Add().Range();               // get Range object
range.InsertAfter(str);                  // insert string
word.Visible = 1;                        // show on screen

 

See MSWORD2 for an example of copying an entire Worksheet.

See Also:

CREATEOBJECT

GETOBJECT

MSWORD2