Set activation key

Namespace:  SautinSoft
Assembly:  UseOffice (in UseOffice.dll) Version: 4.9.1.1

Syntax

      
 C#  Visual Basic 
public string Serial { set; }
Public WriteOnly Property Serial As String

Remarks

After purchasing you will get the full version of product and your serial number. This parameter doesn't have any effect in the trial version. This parameter is necessary in full version, please don't forget to specify it by your serial number.



Examples

CopyHow to activate the component after purchasing in C#
using System;
using System.IO;
using System.Collections;

namespace Sample
{
    class Test
    {

        static void Main(string[] args)
        {

            // Activation of UseOffice .Net after purchasing
            SautinSoft.UseOffice u = new SautinSoft.UseOffice();

            // Place your serial number here.
            // You will get an own serial number after purchasing the license.
            // If have any questions, email us to sales@sautinsoft.com or ask at online chat https://www.sautinsoft.com.
            u.Serial = "1234567890";

            string inpFile = Path.GetFullPath(@"..\..\..\..\..\Testing files\example.docx");
            string outFile = Path.GetFullPath("Result.pdf");

            // Prepare UseOffice .Net, loads MS Word in memory
            int ret = u.InitWord();

            // Return values:
            // 0 - Loading successfully
            // 1 - Can't load MS Word library in memory 

            if (ret == 1)
            {
                Console.WriteLine("Errro! Can't load MS Word library in memory.");
                return;
            }

            // Perform the conversion.
            ret = u.ConvertFile(inpFile, outFile, SautinSoft.UseOffice.eDirection.DOCX_to_PDF);

            // Release MS Word from memory
            u.CloseWord();

            // 0 - Converting successfully
            // 1 - Can't open input file. Check that you are using full local path to input file, URL and relative path are not supported
            // 2 - Can't create output file. Please check that you have permissions to write by this path or probably this path already used by another application
            // 3 - Converting failed, please contact with our Support Team
            // 4 - MS Office isn't installed. The component requires that any of these versions of MS Office should be installed: 2000, XP, 2003, 2007, 2010, 2013, 2016 or 2019.
            if (ret == 0)
            {
                // Open the result.
                System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo(outFile) { UseShellExecute = true });
            }
            else
                Console.WriteLine("Error! Please contact with SautinSoft support: support@sautinsoft.com.");
        }
    }
}
CopyHow to activate the component after purchasing in VB.Net
Imports System
Imports System.IO
Imports System.Collections

Namespace Sample
    Friend Class Test

        Shared Sub Main(ByVal args() As String)

            ' Activation of UseOffice .Net after purchasing
            Dim u As New SautinSoft.UseOffice()

            ' Place your serial number here.
            ' You will get an own serial number after purchasing the license.
            ' If have any questions, email us to sales@sautinsoft.com or ask at online chat https://www.sautinsoft.com.
            u.Serial = "1234567890"

            Dim inpFile As String = Path.GetFullPath("..\..\..\..\Testing files\example.docx")
            Dim outFile As String = Path.GetFullPath("Result.pdf")

            ' Prepare UseOffice .Net, loads MS Word in memory
            Dim ret As Integer = u.InitWord()

            ' Return values:
            ' 0 - Loading successfully
            ' 1 - Can't load MS Word library in memory 


            If ret = 1 Then
                Console.WriteLine("Errro! Can't load MS Word library in memory.")
                Return
            End If

            ' Perform the conversion.
            ret = u.ConvertFile(inpFile, outFile, SautinSoft.UseOffice.eDirection.DOCX_to_PDF)

            ' Release MS Word from memory
            u.CloseWord()

            ' 0 - Converting successfully
            ' 1 - Can't open input file. Check that you are using full local path to input file, URL and relative path are not supported
            ' 2 - Can't create output file. Please check that you have permissions to write by this path or probably this path already used by another application
            ' 3 - Converting failed, please contact with our Support Team
            ' 4 - MS Office isn't installed. The component requires that any of these versions of MS Office should be installed: 2000, XP, 2003, 2007, 2010, 2013, 2016 or 2019.
            If ret = 0 Then
                ' Open the result.
                System.Diagnostics.Process.Start(New System.Diagnostics.ProcessStartInfo(outFile) With {.UseShellExecute = True})
            Else
                Console.WriteLine("Error! Please contact with SautinSoft support: support@sautinsoft.com.")
            End If
        End Sub
    End Class
End Namespace

See Also