ExcelToPdfeOutputFormat Enumeration |
Enumerator with types of produced documents: PDF, DOCX, RTF
Namespace: SautinSoftAssembly: SautinSoft.ExcelToPdf (in SautinSoft.ExcelToPdf.dll) Version: 2024.11.30
Syntax public enum eOutputFormat
Public Enumeration eOutputFormat
Members Member name | Value | Description |
---|
Pdf | 0 |
Set PDF as output document, *.pdf
|
Word | 1 | Obsolete.
Set Word (*.doc) as output document, *.doc
|
Rtf | 2 |
Set RTF as output document, *.rtf
|
Docx | 3 |
Set DOCX as output document, *.docx
|
Example Convert Excel file to DOCX file in C#
using System;
using System.IO;
using SautinSoft;
namespace Sample
{
class Sample
{
static void Main(string[] args)
{
ExcelToPdf x = new ExcelToPdf();
x.OutputFormat = SautinSoft.ExcelToPdf.eOutputFormat.Docx;
string excelFile = Path.GetFullPath(@"..\..\..\test.xlsx");
string docxFile = Path.ChangeExtension(excelFile, ".docx"); ;
try
{
x.ConvertFile(excelFile, docxFile);
System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo(docxFile) { UseShellExecute = true });
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
Console.ReadLine();
}
}
}
}
Convert Excel file to DOCX file in VB.Net
Imports System
Imports System.IO
Imports SautinSoft
Module Sample
Sub Main()
Dim x As New ExcelToPdf()
x.OutputFormat = SautinSoft.ExcelToPdf.eOutputFormat.Docx
Dim excelFile As String = Path.GetFullPath("..\..\..\test.xlsx")
Dim docxFile As String = Path.ChangeExtension(excelFile, ".docx")
Try
x.ConvertFile(excelFile, docxFile)
System.Diagnostics.Process.Start(New System.Diagnostics.ProcessStartInfo(docxFile) With {.UseShellExecute = True})
Catch ex As Exception
Console.WriteLine(ex.Message)
Console.ReadLine()
End Try
End Sub
End Module
See Also