FootnoteStory not available

D

Dave Neve

HelloI used the following code and was told that my footnotes story was not
available.On Error GoTo errhandlerSet MyRange =
ActiveDocument.StoryRanges(wdFootnotesStory)errhandler:If Err = 5941 Then
MsgBox "The footnotes story is not available."There are footnotes though so
I have two questions.Are footnotes automatically FooNteStories ?If 'yes',
why might my Footnotestories not be available?Thanks as always
 
P

Peter Hewett

Hi Dave Neve

The only time I could reproduce this with "Footnotes" was in fact when they were
actually "EndNotes".

Does: ActiveDocument.Footnotes.Count show you what you expect.

HTH + Cheers - Peter
 
D

Dave Neve

Hi

The following code tells me that there are zero footnotes in the document
although I clearly have footnotes.

Sub Pieds()
MsgBox "There are " & Footnotes.Count & _
" footnotes in the doc."

So could you tell me what end notes are instead?

Thanks
 
P

Peter Hewett

Hi Dave Neve

Footnotes go at the bottom of the page whereas EndNotes go at either the end of
the section or end of the document.

Change your code to:

MsgBox "There are " & ActiveDocument.Endnotes.Count & _
" endnotes in the doc."

If this works, the you need to change:
Set MyRange =
ActiveDocument.StoryRanges(wdFootnotesStory

to:
Set MyRange = _
ActiveDocument.StoryRanges(wdEndnotesStory)

HTH + Cheers - Peter
 
D

Dave Neve

Hi

VBA doesn't recognize the endnotes either.
The code runs and the Msgox comes up saying zero
Both the footnotes and endnotes were entered using Word options.

Any ideas please
 
P

Peter Hewett

Hi Dave Neve

I'm out of ideas at the moment.

Exactly what Word commands (or code) did you use to insert these whatever they
ares? And what version of Word are you using?

Cheers - Peter


Hi

VBA doesn't recognize the endnotes either.
The code runs and the Msgox comes up saying zero
Both the footnotes and endnotes were entered using Word options.

Any ideas please

HTH + Cheers - Peter
 
D

Dave Neve

Hi

I used the Word commands in the menu 'display'.
There were two, one for 'headers and footnotes' and one for end of 'notes at
bottom of page'.

I can't give you exact English equivalents as my menus are in French but I
assure you I didn't just stick a few words at the bottom of the page without
further ado.

I have XP and Word 2002.

Guess I'll have to assume it's a bug.

Thanks anyway
 
P

Peter Hewett

Hi Dave Neve

SInce I not sure exactly what you've done can you try it again on another
document and see if the code works as expected on that.

If the code does not work, record a macro of you inserting just one or two of
these whatever they ares OK. And then post the macro here so I can see exactly
what Word is doing.

HTH + Cheers - Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top