PageSetup.LeftHeaderPicture 属性 (Excel)

返回一个 Graphic 对象,该对象代表标题左侧部分的图片。 用于设置图片的属性。

语法

表达式LeftHeaderPicture

表达 一个代表 PageSetup 对象的变量。

备注

LeftHeaderPicture 属性为只读,但并非其所有属性都为只读。

它必须是 "&G"LeftHeader 属性字符串的一部分,图像才能显示在左侧标头中。

示例

以下示例从 C:\ 添加标题为 Sample.jpg 的图片驱动器到标头的左侧部分。 本示例假定名为“Sample.jpg”的文件位于 C:\ 驱动器上。

Sub InsertPicture() 
 
 With ActiveSheet.PageSetup.LeftHeaderPicture 
 .FileName = "C:\Sample.jpg" 
 .Height = 275.25 
 .Width = 463.5 
 .Brightness = 0.36 
 .ColorType = msoPictureGrayscale 
 .Contrast = 0.39 
 .CropBottom = -14.4 
 .CropLeft = -28.8 
 .CropRight = -14.4 
 .CropTop = 21.6 
 End With 
 
 ' Enable the image to show up in the left header. 
 ActiveSheet.PageSetup.LeftHeader = "&G" 
 
End Sub

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。