NamedRange.CopyPicture(XlPictureAppearance, XlCopyPictureFormat) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
將 NamedRange 控制項以圖片形式複製到 [剪貼簿]。
public object CopyPicture (Microsoft.Office.Interop.Excel.XlPictureAppearance Appearance = Microsoft.Office.Interop.Excel.XlPictureAppearance.xlScreen, Microsoft.Office.Interop.Excel.XlCopyPictureFormat Format = Microsoft.Office.Interop.Excel.XlCopyPictureFormat.xlPicture);
abstract member CopyPicture : Microsoft.Office.Interop.Excel.XlPictureAppearance * Microsoft.Office.Interop.Excel.XlCopyPictureFormat -> obj
Public Function CopyPicture (Optional Appearance As XlPictureAppearance = Microsoft.Office.Interop.Excel.XlPictureAppearance.xlScreen, Optional Format As XlCopyPictureFormat = Microsoft.Office.Interop.Excel.XlCopyPictureFormat.xlPicture) As Object
參數
- Appearance
- XlPictureAppearance
指定圖片的複製方式。可以為下列 XlPictureAppearance 其中一個常數: xlPrinterxlScreen
- Format
- XlCopyPictureFormat
圖片的格式。可以為下列 XlCopyPictureFormat 其中一個常數: xlBitmapxlPicture
傳回
範例
下列程式代碼範例會建立 並 NamedRange 填入 Smith 一詞。 然後, CopyPicture 它會使用 方法將 複製到 NamedRange 剪貼簿做為位圖。
此範例適用於檔層級自定義。
Microsoft.Office.Tools.Excel.NamedRange copyBitmapRange;
private void CopyAsBitmap()
{
copyBitmapRange = this.Controls.AddNamedRange(
this.Range["C3"], "copyBitmapRange");
this.copyBitmapRange.Value2 = "Smith";
this.copyBitmapRange.CopyPicture(
Excel.XlPictureAppearance.xlScreen,
Excel.XlCopyPictureFormat.xlBitmap);
}
Private copyBitmapRange As Microsoft.Office.Tools.Excel.NamedRange
Private Sub CopyAsBitmap()
copyBitmapRange = Me.Controls.AddNamedRange( _
Me.Range("C3"), "copyBitmapRange")
Me.copyBitmapRange.Value2 = "Smith"
Me.copyBitmapRange.CopyPicture( _
Excel.XlPictureAppearance.xlScreen, _
Excel.XlCopyPictureFormat.xlBitmap)
End Sub
備註
選擇性參數
如需選擇性參數的資訊,請參閱 Office 方案中的選擇性參數。