Getting the actual footnote/endnote symbol

R

richardchaven

I am writing a macro to translate Word documents into PmWiki format.

I want to get the actual character Word displays for as the footnote or
endnote symbol (e.g. *, ‡).

Does the Footnote/Endnote object have a secret property with this
information ? Can I at least access the Word function that returns the
symble given the index and format ?

TIA
 
P

Peter Jamieson

You might be able to do that if the footnote number has been provided
explicitly. Otherwise, Word just works it out using its own algorithm. If
you want to get the character /as displayed/ then manipulate the Word user
interface - you may be able to selct the character(s) word uses. If you want
to see what Word is doing internally, save the document in .rtf format and
work it out from there (the RTF specification is on the MS site somewhere
last time I looked).

If you're extracting stuff to put n wikipedia, maybe you don't need to be so
precise about the format of your references. If you're using some wiki
format standard for some other purpose, maybe the standard doesn't support
what you want.

Peter Jamieson

I am writing a macro to translate Word documents into PmWiki format.

I want to get the actual character Word displays for as the footnote or
endnote symbol (e.g. *, ?).

Does the Footnote/Endnote object have a secret property with this
information ? Can I at least access the Word function that returns the
symble given the index and format ?

TIA
 
R

richardchaven

"...Word just works it out using its own algorithm"

I want access to that algorithm! <s>

Any ideas ?
 
P

Peter Jamieson

All I can suggest is that yu open the footnote pane using e.g.

With ActiveDocument.ActiveWindow.View
.Type = wdNormalView
.SplitSpecial = wdPaneFootnotes
End With

then go through each footnote while that is the active pane

Selection.GoTo What:=wdGoToFootnote, Which:=wdGoToNext, Count:=1, Name:=""

then examine the text in Footnote Reference style at the beginning of each
note. I don't know a way to be sure that the user has not added more text in
that style immediately after the footnote marker.

I expect there's an easier way but that's what occurs to me at the moment.

Peter Jamieson
 
T

Tony Jollans

As far as I know, there's no easy way and you will find this awkward - but
it should be possible.

Custom Symbols are straightforward - just look at the Text. Otherwise the
Text will be Chr(2) and so ...

From the Range of any individual Footnote Reference (in the document body)
take a note of the Start and End positions. Next, run through the Footnotes
Collection to find the Footnote with the same Start and End. You now have
access to the correct Footnote.

Now look at the FootnoteOptions and find the NumberStyle and then work out
the symbol from the Footnote Index. I don't know if it's possible to get the
actual character sequences from Word - I think not - so you will probably
need to hard code "a,b,c,.." and "i,ii,iii, ..." etc. Providing your
documents are not using Asian scripts there aren't too many of them!

One last thing ....

... if the Numbering Rule is not "continuous", you'll need to identify the
relative position of the Footnote in the Section or Page.
 

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