Footnote options problem

C

Chuck

Hi All

I've got a problem using Dialogs(wdNoteOptions) to change footnote options.

We're using code to intercept the insert footnote command to make sure that
footnote references at the bottom of the page are not superscripted. The
code is slightly modified code copied from the MVP site (see end of this
post).

Using an InsertFootnote macro seems to disable the footnote/endnote options
dialog (can't get it to display from the standard menu or by right clicking
etc). However we can get it to display by highlighting the note reference in
the text and typing one character -- a Word dialog appears asking if the user
wants to delete (overwrite) the footnote or change the options.

We'd like to be able to call the NoteOptions dialog from a toolbar macro.
However, when I use Dialogs(wdDialogNoteOptions).Show to display the note
options dialog I get unwanted behavior after choosing options and clicking OK.

For instance, if I use Dialogs(wdDialogNoteOptions).Show and choose
"A,B,C..." in the "Number format" field, and click OK, the footnote numbers
change to "i, ii, iii", not "A,B,C". Or if I choose "*, +" etc from the
"Number format" field, the references change to "1st, 2nd" etc, not "*, +"
etc (this latter behaviour is puzzling because "1st, 2nd, 3rd" etc isn't an
option available in the Note Options dialog).

Note that this unwanted behaviour doesn't happen if I highlight the
reference in the text, type a character and bring up the Note Options dialog
that way. So the erratic behaviour appears to be related to be *using code*
to display the Note Options dialog, not the Note Options dialog itself.

Does anyone have any ideas as to why this is happening and more importantly,
how can I get Dialogs(wdDialogNoteOptions).Show to work properly while still
intercepting InsertFootnote to make sure footnote references at the bottom of
the page are not superscripted?

Many thanks for any help -- InsertFootnote code below for reference...

Sub InsertFootnote()
'
'This macro intercepts Insert > Footnote and automatically
'changes footnote numbers from superscript to normal

ActiveDocument.Footnotes.Add Range:=Selection.Range

With Selection
.Paragraphs(1).Range.Font.Reset
.Paragraphs(1).Range.Characters(2) = ""
.InsertAfter "." & vbTab
.Collapse wdCollapseEnd
.Paragraphs(1).Style = "Footnote Text"
End With

End Sub
 
K

Klaus Linke

Hi Chuck,

If you have intercepted the "InsertFootnote" command, you can still show
the dialog with
Dialogs(wdDialogInsertFootnote).Show

I can't reproduce the bug you're seeing, but what I am getting may be even
weirder:

When I try to overtype a footnote reference, and then click on "Options..."
in the dialog that comes up, I can change the numbering style fine ...

But if I "Apply" that style, section breaks are inserted before and after
the footnote reference!?!

Perhaps it would be easier and safer to change the "Footnote reference"
style to "not superscripted", instead of removing this style from the
reference in the macro.

To get the dot, you can run the following line once in the immediate window
or a macro:
ActiveDocument.Footnotes.NumberStyle=5
It's a numbering style that isn't available from the user interface, but I
think it should work fine.

If you need to, you might still replace the space after the reference with
a tab using the code from the MVP FAQ article and an "InsertFootnote"
macro, but maybe that won't be necessary?

Regards,
Klaus
 
C

Chuck

Hi Klaus

Thanks for replying. I should have mentioned that I'm working with Word
2000 (SR1) in Windows 2000 Professional (SP4).

We need to format our footnote references properly (superscripted in text,
not superscripted in the footnote) so I don't see how we can get around
having to intercept Word's (faulty) implementation of footnotes with the
InsertFootnote macro.

I know I can show the dialog using Dialogs(wdDialogInsertFootnote).Show,
that's my problem. The numbering styles in that dialog don't correspond to
the numbering that is applied when I click OK. This is a consistently
reproduceable problem, so I think it qualifies as a bug.

I don't get the section breaks you're getting when you overtype and choose
Options. Maybe we're not seeing the same behaviour because we're in
different versions of Word?

In any case, I think I'm going to have to create a user form that mimics the
Note Options dialog to get around the bug I seem to have stumbled across.

Unless I'm missing something?

Thanks again.

Chuck
 
K

Klaus Linke

Hi Chuck,
Thanks for replying. I should have mentioned that I'm working
with Word 2000 (SR1) in Windows 2000 Professional (SP4).

That may explain the differences we are seeing!
We need to format our footnote references properly (superscripted
in text, not superscripted in the footnote) so I don't see how we can
get around having to intercept Word's (faulty) implementation of
footnotes with the InsertFootnote macro.

Hmm, I certainly wouldn't call that "properly" (or the way Word does it
"faulty).
It doesn't seem desirable IMO to have the footnote references look
differently (in the text vs. in the footnote pane).
But if that are the rules you have, you do have to find a work-around :)
I know I can show the dialog using Dialogs(wdDialogInsertFootnote).Show,
that's my problem. The numbering styles in that dialog don't correspond
to the numbering that is applied when I click OK. This is a consistently
reproduceable problem, so I think it qualifies as a bug.

When I have time, I'll check it out in Word2000. It's a bug I haven't heard
of.
And it's not very probable that bugs in Word2000 will still get fixed, if
they are already fixed in later versions.
[...] In any case, I think I'm going to have to create a user form that
mimics the Note Options dialog to get around the bug I seem to
have stumbled across.

Unless I'm missing something?

I don't quite understand why you have to show the dialog at all.
The numbering style needs to be set only once, best in the template.
(ActiveDocument.Footnotes.NumberStyle=5)
It probably won't ever change afterwards.

Unless you want users to have the ability to change the footnote style, or
insert custom footnotes, start with a different number than "1." ...
But then you'd run into difficulties enforcing your particular footnote
formatting.

You only need to intercept the "InsertFootnote" command afterwards to
change the reference in the footnote pane to "not superscripted" (as in the
macro from www.mvps.org/word).

Regards,
Klaus
 
C

Chuck

Hi Klaus

We need the dialog so users can create endnotes, change footnote numbering
etc. InsertFootnote simply enforces regular size footnote references at the
bottom of the page.

You might want to check out this link from the MVP site for more background
on this issue: http://word.mvps.org/FAQs/MacrosVBA/UnSuperscptFnotes.htm

Thanks for your feedback.

Chuck

Klaus Linke said:
Hi Chuck,
Thanks for replying. I should have mentioned that I'm working
with Word 2000 (SR1) in Windows 2000 Professional (SP4).

That may explain the differences we are seeing!
We need to format our footnote references properly (superscripted
in text, not superscripted in the footnote) so I don't see how we can
get around having to intercept Word's (faulty) implementation of
footnotes with the InsertFootnote macro.

Hmm, I certainly wouldn't call that "properly" (or the way Word does it
"faulty).
It doesn't seem desirable IMO to have the footnote references look
differently (in the text vs. in the footnote pane).
But if that are the rules you have, you do have to find a work-around :)
I know I can show the dialog using Dialogs(wdDialogInsertFootnote).Show,
that's my problem. The numbering styles in that dialog don't correspond
to the numbering that is applied when I click OK. This is a consistently
reproduceable problem, so I think it qualifies as a bug.

When I have time, I'll check it out in Word2000. It's a bug I haven't heard
of.
And it's not very probable that bugs in Word2000 will still get fixed, if
they are already fixed in later versions.
[...] In any case, I think I'm going to have to create a user form that
mimics the Note Options dialog to get around the bug I seem to
have stumbled across.

Unless I'm missing something?

I don't quite understand why you have to show the dialog at all.
The numbering style needs to be set only once, best in the template.
(ActiveDocument.Footnotes.NumberStyle=5)
It probably won't ever change afterwards.

Unless you want users to have the ability to change the footnote style, or
insert custom footnotes, start with a different number than "1." ...
But then you'd run into difficulties enforcing your particular footnote
formatting.

You only need to intercept the "InsertFootnote" command afterwards to
change the reference in the footnote pane to "not superscripted" (as in the
macro from www.mvps.org/word).

Regards,
Klaus
 

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