Forums     Knowledge Base     OfficeWriter Online     
 
 
This documentation is for
OfficeWriter v3.7.1
ASP/COM Platform

View Docs for Another
Version or Platform

Programmer's Reference > ExcelTemplate > ContentType

ContentType Property

Syntax:

ContentType [= MIME Content-Type As String]

Description:

Sets or returns the generated spreadsheet's MIME content type. In most browsers, Microsoft Excel files are mapped to the MIME type "application/vnd.ms-excel" and ExcelWriter's ContentType is set to this value by default. However, some browsers map Excel files to a different MIME content type, and the browser will not open a file of type "application/vnd.ms-Excel." In this case, set ContentType to the appropriate MIME content type.

In Internet Explorer, to find out what MIME content type maps to Excel files:

  1. Open the Start menu and select Run.
  2. Entire regedit to open the Registry Editor.
  3. Open HKEY_CLASSES_ROOT\MIME\Database\Content Type. This folder contains a list of MIME content type folders. If you select a folder, you will see the extensions to which the type maps in the right frame.

In Netscape Navigator, to find out what MIME content type maps to Excel files:

  1. In the browser window, open the Edit menu and select Preferences...
  2. In the Category window select Applications.
  3. In the Description window, select an application to display its MIME content type.

Example:

Set objSAXLTmplt = Server.CreateObject("SoftArtisans.ExcelTemplate") 
...
Set Recordset = adoConnect.Execute(sqlText)
objSAXLTmplt.Open Server.MapPath(Application("vroot") &_
		 "templates/simpletemplate.xls")
objSAXLTmplt.DataSource("Recordset") = Recordset
objSAXLTmplt.ContentType = "application/unknown"
objSAXLTmplt.Process "TemplateSample.xls", saProcessOpenInPlace



Copyright 2006 © SoftArtisans, Inc. All Rights Reserved.