GdPicture.NET.14.API
GdPicture14 Namespace / GdPictureDocumentUtilities Class / GetDocumentFormatFromFileName Method
The file name of the required document.

The method does not care about the full file path or the file itself as it only examines the file extension.

Example





In This Topic
GetDocumentFormatFromFileName Method (GdPictureDocumentUtilities)
In This Topic
Determines the document format in accordance with the specified file name of that document.

This method recognizes only the file extension to get the known document format. Please use the GdPictureDocumentUtilities.GetDocumentFormat method or its overloads to validate also the document content if the file extension is unknown or misleading.

Syntax
'Declaration
 
Public Shared Function GetDocumentFormatFromFileName( _
   ByVal FileName As String _
) As DocumentFormat
public static DocumentFormat GetDocumentFormatFromFileName( 
   string FileName
)
public function GetDocumentFormatFromFileName( 
    FileName: String
): DocumentFormat; static; 
public static function GetDocumentFormatFromFileName( 
   FileName : String
) : DocumentFormat;
public: static DocumentFormat GetDocumentFormatFromFileName( 
   string* FileName
) 
public:
static DocumentFormat GetDocumentFormatFromFileName( 
   String^ FileName
) 

Parameters

FileName
The file name of the required document.

The method does not care about the full file path or the file itself as it only examines the file extension.

Return Value

A member of the DocumentFormat enumeration. The format of the specified document.
Remarks
Be aware that this method only checks the file extension to identify the document format.
Example
How to properly retrieve the document format of a specified file.
Dim documentFormat As GdPicture14.DocumentFormat = GdPictureDocumentUtilities.GetDocumentFormatFromFileName("document.docx")
GdPicture14.DocumentFormat documentFormat = GdPictureDocumentUtilities.GetDocumentFormatFromFileName("document.docx");
See Also