|  | This document is archived and information here might be outdated. Recommended version. | 
| ArcObjects Help for .NET developers > ArcObjects namespaces > Carto > ESRI.ArcGIS.Carto > Interfaces > IK > IKmlConversion Interface > IKmlConversion.LayerToFile Method (ArcObjects .NET 10.5 SDK) | 
Converts a layer to KML and outputs a KMZ file.
[Visual Basic .NET] Public Sub LayerToFile ( _ ByVal pLayer As ILayer, _ ByVal pQueryFilter As IQueryFilter, _ ByVal pKmlParameters As IPropertySet, _ ByVal Filename As String _ )
[C#] public void LayerToFile ( ILayer pLayer, IQueryFilter pQueryFilter, IPropertySet pKmlParameters, string Filename );
[C++]
HRESULT LayerToFile(
  ILayer* pLayer,
  IQueryFilter* pQueryFilter,
  IPropertySet* pKmlParameters,
  BSTR Filename
);
[C++]
Parameters pLayer [in]
pLayer is a parameter of type ILayer pQueryFilter [in]
pQueryFilter is a parameter of type IQueryFilter pKmlParameters [in]
pKmlParameters is a parameter of type IPropertySet Filename [in] Filename is a parameter of type BSTR