Excel) (图形对象

包括应用于页眉和页脚的图片对象的属性。

备注

使用以下 PageSetup 对象的属性可返回 Graphic 对象:

注意

若要在左页脚中显示图像,“&G”必须是 LeftFooter 字符串的一部分。

示例

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

Sub InsertPicture() 
 
 With ActiveSheet.PageSetup.LeftFooterPicture 
 .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 footer. 
 ActiveSheet.PageSetup.LeftFooter = "&G" 
 
End Sub

属性

另请参阅

支持和反馈

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