다음을 통해 공유


ServerDocument.IsCustomized Method

Gets a value that indicates whether the specified document has a customization that was created by using the Visual Studio 2010 Tools for Office Runtime.

Namespace:  Microsoft.VisualStudio.Tools.Applications
Assembly:  Microsoft.VisualStudio.Tools.Applications.ServerDocument (in Microsoft.VisualStudio.Tools.Applications.ServerDocument.dll)

Syntax

'Declaration
Public Shared Function IsCustomized ( _
    documentPath As String _
) As Boolean
public static bool IsCustomized(
    string documentPath
)

Parameters

  • documentPath
    Type: System.String

    The full path of the document that you want to check for a customization.

Return Value

Type: System.Boolean
true if the document has a customization that was created by using the Visual Studio 2010 Tools for Office Runtime; false if the document does not have a customization.

Exceptions

Exception Condition
ArgumentNullException

The documentPath parameter is nulla null reference (Nothing in Visual Basic) or empty or consists entirely of white space characters.

FileNotFoundException

The file in documentPath does not exist.

DocumentCustomizedWithPreviousRuntimeException

The file specified by documentPath has a customization that was not created with the Visual Studio 2010 Tools for Office Runtime or the Visual Studio Tools for the Microsoft Office system (version 3.0 Runtime).

Remarks

This method throws an exception if the specified document has a customization that was not created with the Visual Studio 2010 Tools for Office Runtime or the Visual Studio Tools for the Microsoft Office system (version 3.0 Runtime). For example, this method throws an exception if you specify a document that was created by using a project template for Microsoft Office 2003 in Visual Studio 2008, because these project templates use the Visual Studio 2005 Tools for Office Second Edition runtime.

To determine whether a document has a customization that was created by using any version of Visual Studio, use the GetCustomizationVersion method instead of the IsCustomized method. GetCustomizationVersion returns 0 (zero) if the document does not have a customization.

.NET Framework Security

See Also

Reference

ServerDocument Class

Microsoft.VisualStudio.Tools.Applications Namespace