返回一个
Graphic 对象,该对象表示页眉左边的图片。用于设置图片的属性。
语法
表达式.LeftHeaderPicture
表达式 一个代表 PageSetup 对象的变量。
说明
LeftHeaderPicture 属性为只读,但并非其所有属性都为只读。
注释 |
要求 "&G" 为 LeftHeader 属性字符串的组成部分,以便在左边的页眉中显示图像。 |
示例
本示例将 C: 驱动器中名为“Sample.jpg”的图片添加到页眉的左边。本示例假定名为“Sample.jpg”的文件位于 C: 驱动器上。
示例代码 |
function test() {
let picture = ActiveSheet.PageSetup.LeftHeaderPicture
picture.FileName = "C:\\Sample.jpg"
picture.Height = 275.25
picture.Width = 463.5
picture.Brightness = 0.36
picture.ColorType = msoPictureGrayscale
picture.Contrast = 0.39
picture.CropBottom = -14.4
picture.CropLeft = -28.8
picture.CropRight = -14.4
picture.CropTop = 21.6
// Enable the image to show up in the center footer.
ActiveSheet.PageSetup.CenterFooter = "&G"
}
|