Enumerator with types of produced documents: PDF, Word, RTF

Namespace:  SautinSoft
Assembly:  SautinSoft.ExcelToPdf (in SautinSoft.ExcelToPdf.dll) Version: 4.0.2.29

Syntax

      
 C#  Visual Basic 
public enum eOutputFormat
Public Enumeration eOutputFormat

Members

MemberDescription
Pdf
Set PDF as output document, *.pdf
Word
Set Word (*.doc) as output document, *.doc
Rtf
Set RTF as output document, *.rtf
Docx
Set DOCX as output document, *.docx

Remarks

Examples

CopyConvert Excel file to DOCX file in C#
using System;
using System.IO;
using SautinSoft;

namespace Sample
{
    class Sample
    {
        static void Main(string[] args)
        {
            // Convert Excel file to DOCX file
            ExcelToPdf x = new ExcelToPdf();

            // Set DOCX as output format.
            x.OutputFormat = SautinSoft.ExcelToPdf.eOutputFormat.Docx;

            string excelFile = Path.GetFullPath(@"..\..\..\..\test.xls");
            string docxFile = Path.ChangeExtension(excelFile, ".docx"); ;

            try
            {
                x.ConvertFile(excelFile, docxFile);
                System.Diagnostics.Process.Start(docxFile);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                Console.ReadLine();
            }

        }
    }
}
CopyConvert Excel file to DOCX file in VB.Net
Imports System
Imports System.IO
Imports SautinSoft

Module Sample

    Sub Main()
        ' Convert Excel file to DOCX file
        Dim x As New ExcelToPdf()

        ' Set DOCX as output format.
        x.OutputFormat = SautinSoft.ExcelToPdf.eOutputFormat.Docx

        Dim excelFile As String = Path.GetFullPath("..\..\..\test.xls")
        Dim docxFile As String = Path.ChangeExtension(excelFile, ".docx")

        Try
            x.ConvertFile(excelFile, docxFile)
            System.Diagnostics.Process.Start(docxFile)
        Catch ex As Exception
            Console.WriteLine(ex.Message)
            Console.ReadLine()
        End Try

    End Sub
End Module

See Also