![]() |
|
|
|
#1
|
|||
|
|||
|
Hi, macropod
Thank you for your explanation, now I get it ![]() Sorry I have last 2 questions. What if instead of checking if the words are exactly the same, we check if the words are similar? Will this cause a problem? Instead of using sections, can I check page by page? Thank you |
|
#2
|
||||
|
||||
|
Quote:
I can't see what Sections has to do with this - your example document still only has one Section. Regardless, for a multi-Section document, all you'd be doing is repeating the same comparison issue for every Section.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
#3
|
|||
|
|||
|
Hi, macropod
Do you know other ways to get all headers from the word document? At first, I wanted to go through the word document using page by page. However, I have searched online and found out that I can't do that as Word is not a page layout software. I have also tried using StoryRanges. Code:
Sub getHeader()
Dim oStory As Range
MakeHValid
For Each oStory In ActiveDocument.StoryRanges
Do
If oStory.StoryType = wdPrimaryHeaderStory Then
MsgBox "There is a header"
MsgBox oStory
End If
Get next linked story
Set oStory = oStory.NextStoryRange
Loop Until oStory Is Nothing
Next
End Sub
Public Sub MakeHValid()
Dim lngjunk As Long
lngjunk = ActiveDocument.Range.StoryType
End Sub
Code:
MsgBox ActiveDocument.StoryRanges(wdPrimaryHeaderStory) Thus, I am thinking if there is any way to get all the headers. Thank you for your help |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Apply template with headers/footers to an existing Word document Files | qadeerahmed | Word | 5 | 05-08-2017 05:28 AM |
| Headers & Footers - Show Document Text | Aprilann | Word | 6 | 04-13-2017 09:34 AM |
Word 2007 - different text for odd and even headers?
|
JQP | Word | 4 | 10-09-2011 06:49 PM |
| How do I have headers and footers appear as regular text for the whole document? | user908045 | Word | 0 | 03-13-2010 12:41 PM |
| Portrait & Landscape Headers in Same Word Document | Coast331 | Word | 0 | 10-24-2009 02:39 PM |