ChartSheetBase.ExportAsFixedFormat Method
Saves the chart that is displayed on the ChartSheetBase in PDF or XPS format.
Namespace: Microsoft.Office.Tools.Excel
Assembly: Microsoft.Office.Tools.Excel.v4.0.Utilities (in Microsoft.Office.Tools.Excel.v4.0.Utilities.dll)
Syntax
'Declaration
Public Sub ExportAsFixedFormat ( _
type As XlFixedFormatType, _
filename As Object, _
quality As Object, _
includeDocProperties As Object, _
ignorePrintAreas As Object, _
from As Object, _
to As Object, _
openAfterPublish As Object, _
fixedFormatExtClassPtr As Object _
)
public void ExportAsFixedFormat(
XlFixedFormatType type,
Object filename,
Object quality,
Object includeDocProperties,
Object ignorePrintAreas,
Object from,
Object to,
Object openAfterPublish,
Object fixedFormatExtClassPtr
)
Parameters
- type
Type: Microsoft.Office.Interop.Excel.XlFixedFormatType
One of the Microsoft.Office.Interop.Excel.XlFixedFormatType values that specifies whether to save the chart in PDF or XPS format.
- filename
Type: System.Object
The full path of the new PDF or XPS file. If you omit this parameter, Excel saves the file in the current folder.
- quality
Type: System.Object
One of the Microsoft.Office.Interop.Excel.XlFixedFormatQuality values that specifies the quality of the exported file.
- includeDocProperties
Type: System.Object
true to include document properties in the exported file; otherwise, false.
- ignorePrintAreas
Type: System.Object
true to ignore any print areas set when exporting; otherwise, false.
- from
Type: System.Object
The number of the page at which to start exporting. If this parameter is omitted, exporting starts at the beginning.
- to
Type: System.Object
The number of the last page to publish. If this parameter is omitted, publishing ends with the last page.
- openAfterPublish
Type: System.Object
true to open the new file in the viewer immediately; otherwise, false.
- fixedFormatExtClassPtr
Type: System.Object
A pointer to an implementation of the IMsoDocExporter interface that enables the chart to be saved in a different fixed format. For more information, see Extending the Office (2007) Fixed-Format Export Feature.
Remarks
You can save as a PDF or XPS file from Microsoft Office Excel only after you install an add-in that provides this feature. For more information, search for "Enable support for other file formats, such as PDF and XPS" on Office Online.
Optional Parameters
For information about optional parameters, see Optional Parameters in Office Solutions.
Examples
The following code example saves one page of chart sheet Chart1 in PDF format to the specified file path and file name using the standard quality resolution. The generated PDF file includes the workbook properties. To run this code example, your workbook must contain a chart sheet named Chart1.
Private Sub SaveChartSheetAsPDF()
Dim myChartSheet As Microsoft.Office.Tools.Excel.ChartSheet = _
Globals.Chart1.Base
myChartSheet.ExportAsFixedFormat( _
Excel.XlFixedFormatType.xlTypePDF, _
"c:\SalesChartSheet", _
Excel.XlFixedFormatQuality.xlQualityStandard, _
True, _
True, _
1, _
1, _
False)
End Sub
private void SaveChartSheetAsPDF()
{
Microsoft.Office.Tools.Excel.ChartSheet myChartSheet =
Globals.Chart1.Base;
myChartSheet.ExportAsFixedFormat(
Excel.XlFixedFormatType.xlTypePDF,
@"c:\SalesChartSheet",
Excel.XlFixedFormatQuality.xlQualityStandard,
true,
true,
1,
1,
false,
missing);
}
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.