<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="dispatch.xsl" ?>
<Object name="Document" project="SuperEdi">

  <Title>Document Object</Title>

  <ProgID>SuperEdi.Document</ProgID>

  <Description>The Document object represents a text document.</Description>
  
  <Keywords>Application, FullName, Name, Parent, Path, Saved, LineCount,
    Text, Title, Line, Save, SaveAs, ReadOnly, Selection, FileType, FileTypeName,
    CodePage, Encoding</Keywords>

  <Property name="Application" type="Application" write="no" xlink="yes">
    <Description>Returns the Application object</Description>
  </Property>

  <Property name="CodePage" type="ulong">
    <Description>
      Returns or sets the code page used for
      saving this document. The following values have a special meaning:
      0=ANSI, -1=UTF-16
    </Description>
  </Property>
  
  <Property name="Encoding" type="string">
    <Description>
      Returns or sets the name of the character set name of the
      code page used for saving by this document, for example
      "utf-8" or "iso-8859-1".
    </Description>
  </Property>

  <Property name="FileType" type="FileType" write="no" xlink="yes">
    <Description>
      Returns the user defined file type that is used for
      the document.</Description>
  </Property>

  <Property name="FileTypeName" type="FileType">
    <Description>
      Returns the file type name or sets the file type of the
      document.
    </Description>
  </Property>

  <Property name="FullName"  type="string"  write="no">
    <Description>Returns the file specification of the document,
      including the path.</Description>
  </Property>

  <Property name="LineCount"  type="long"  write="no">
    <Description>Returns the number of lines.</Description>
  </Property>

  <Property name="Name"  type="string"  write="no">
    <Description>Returns the file name of the document, not including
      the file's path specification.</Description>
  </Property>

  <Property name="Parent" type="Application" write="no" xlink="yes">
    <Description>Returns the Application object</Description>
  </Property>
  
  <Property name="Path"  type="string"  write="no">
    <Description>Returns the path specification for the document, not 
      including the file name or file name extension.</Description>
  </Property>

  <Property name="ReadOnly"  type="boolean" >
    <Description>Gets or sets whether the document is read-only.</Description>
  </Property>

  <Property name="Selection" type="Selection" write="no" xref="yes">
    <Description>Returns the Selection object, which represents the 
      selected text.</Description>
  </Property>
  
  <Property name="Saved"  type="boolean">
    <Description>Returns True if the document has never been saved, but 
      has not changed since it was created. Returns True if it has been 
      saved and has not changed since last saved. Returns False if it 
      has never been saved and has changed since it was created; or if 
      it was saved, but has changed since last saved.</Description>
  </Property>

  <Property name="Text"  type="string">
    <Description>Sets or returns the content of the document.
      The Text property is the default member.</Description>
  </Property>

  <Property name="Title"  type="string"  write="no">
    <Description>Returns the title of the document.</Description>
  </Property>

  <!-- Methods -->

  <Method name="Activate">
    <Description>Activates the first window associated with the document.</Description>
    <Syntax>document.Activate()</Syntax>
  </Method>

  <Method name="ApplyFilter">
    <Description>Applies a TextPipe filter to the document text.</Description>
    <Syntax>document.ApplyFilter( FilterPath )</Syntax>
	<Parameter name="FilterPath" type="string">
	  <Description>Full path to the filter file (.fll).</Description>
	</Parameter>
  </Method>

  <Method name="Close">
    <Description>Closes all windows associated with the document and 
      removes the document from the Documents collection.</Description>
    <Syntax>document.Close()</Syntax>
  </Method>

  <Method name="Line">
    <Description>Returns the line specified by zero-based index.</Description>
    <Syntax>document.Line( index )</Syntax>
	<Parameter name="index" type="long" />
	<Return type="string" />
  </Method>

  <Method name="Load">
    <Description>Loads a document from a file.</Description>
    <Syntax>document.Load( filename )</Syntax>
	<Parameter name="filename" type="string">
	  <Description>file name or URL</Description>
	</Parameter>
  </Method>

  <Method name="Reload">
    <Description>Reloads the document from the current file, given by
	  document's FullName property.</Description>
    <Syntax>document.Reload()</Syntax>
  </Method>

  <Method name="Print">
    <Description>Prints the document.</Description>
    <Syntax>document.Print()</Syntax>
  </Method>

  <Method name="Save">
    <Description>Saves changes to the file specified in the document's
      FullName property.</Description>
    <Syntax>document.Save()</Syntax>
  </Method>
  
  <Method name="SaveAs">
    <Description>Saves changes to a file.</Description>
    <Syntax>document.SaveAs( filename )</Syntax>
	<Parameter name="filename" type="string" />
  </Method>

  <Example language="JScript">
var doc = new ActiveXObject( "SuperEdi.Document" );
doc.Application.Visible = true;
var doc2 = doc.Application.Documents.Open( "C:\\autoexec.bat" );
WScript.Echo( doc2.Text );
  </Example>
</Object>