![]() |
|
|
Thread Tools | Display Modes |
#2
|
||||
|
||||
![]()
In my experience with floating shapes in the headers, VBA seems to think all the shapes are in every section even though the user interface shows a graphic only in one sections header. This can be further complicated when some headers may have 'Link to Previous' turned on.
So I have no faith at all in being able to use VBA to determine which shape you are referring to via the section number. If you have some shapes in your document headers, try this macro to see the way VBA keeps track of these shapes. Code:
Sub TestHeaderFloaters() Dim aH As HeaderFooter, aShp As shape, aSect As Section Debug.Print ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Shapes.Count For Each aSect In ActiveDocument.Sections For Each aH In aSect.Headers For Each aShp In aH.Shapes Debug.Print aSect.Index, aH.Index, aShp.Anchor.Information(wdActiveEndSectionNumber), aShp.AlternativeText Next aShp Next aH Next aSect End Sub
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Footnote numbering wrong after section break | peterbav | Word | 1 | 03-17-2020 11:18 PM |
![]() |
dhare | Excel Programming | 2 | 02-24-2016 12:36 PM |
![]() |
nmp13 | Excel | 3 | 02-06-2016 02:13 AM |
Multilevel Numbering wrong after Section Break | Kay Wood | Word | 2 | 01-16-2013 08:44 AM |
Help with VBA macro - Variable input | sc30317 | Excel Programming | 0 | 08-31-2011 01:00 PM |