0
我想删除,并在Word(页眉和页脚)一个按钮删除,并在Word
添加现有形状添加形状,但我不能选择形状改变,可见属性。
我该怎么做?我无法弄清Word中形状的名称
感谢您的帮助!
Sub LogoChangeVisible()
'
' Removes and adds the logo from Header and Footer
'
'
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
Selection.HeaderFooter.Shapes("Picture from Header").Select
If Selection.ShapeRange.Visible = msoTrue Then
Selection.ShapeRange.Visible = msoFalse
Selection.HeaderFooter.Shapes("Picture from Footer").Select
Selection.ShapeRange.Visible = msoFalse
ElseIf Selection.ShapeRange.Visible = msoFalse Then
Selection.ShapeRange.Visible = msoTrue
Selection.HeaderFooter.Shapes("Picture from Footer").Select
Selection.ShapeRange.Visible = msoTrue
End If
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
End Sub
它没有找到任何形状。如果它是一张jpg图片,它会算作一个形状吗? –
是的,它算作一个形状,但它也可以是内联形状。试试这个: Debug.Print ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Range.InlineShapes.Count – Sam