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