Results 1 to 9 of 9
  1. #1
    Ursusmaximus
    Guest

    Square brackets round endnote numbers (W97 SR-1)

    Hi!

    We're preparing a document for publication that has hundreds of endnotes, and we want to have the reference in the text look like this: [1].

    As far as I can see, Word's footnotes/endnotes feature doesn't allow you to put these square brackets around the number, and there seems to be no way of achieving this by messing with the Endnote Reference style (it's only a font style).

    Sure, we could create the endnotes as an autonumbered list, located at the end of the doc, and then cross-reference to the items in that list (an approach I've adopted successfully in the past), but: the doc wasn't constructed that way (and re-doing all those endnotes is not our idea of fun), and the people who have to maintain it are Word beginners (I really can't inflict that degree of complexity on them!).

    If all else fails, we'll use search and replace to insert the square brackets later, but that's a bit of a lame kludge.

    So ... does anyone know of a way of building the square brackets into the number, like you can when you're using Heading Numbering?

    TIA

    Steve

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Square brackets round endnote numbers (W97 SR-1)

    I am not able to test whether this works in Word97, as I run Word2000. This little macro sweeps through all of the endnotes changing them from auto-numbered to custom numbered. Best not to do this until you're ready to "publish," although it can be run multiple times if necessary. As far as I can tell, the collection is indexed in the proper order, but my experimentation has been limited. Hope this helps:

    Sub BracketNotes()
    Dim aNote As Endnote
    For Each aNote In ActiveDocument.Endnotes
    aNote.Reference.Select
    With Dialogs(wdDialogInsertFootnote)
    .Reference = "[" & Trim(Str(aNote.Index)) & "]"
    .Execute
    End With
    Next
    End Sub

  3. #3
    Ursusmaximus
    Guest

    Re: Square brackets round endnote numbers (W97 SR-1)

    Hi.

    Many thanks for the code -- I'll certainly try it, <img src=/S/yum.gif border=0 alt=yum width=15 height=15> but we've pretty well decided to abandon the square brackets idea and just go with Word's superscript, unbracketed numbers, as maintaining the brackets once they go in as "loose" characters is a really good source of mistakes!

    Thanks again!

  4. #4
    Lounger
    Join Date
    Jan 2001
    Location
    Milton Keynes, Buckinghamshire, England
    Posts
    48
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Square brackets round endnote numbers (W97 SR-1)

    Steve,

    We had a similar requirement here where one of our courses wanted the endnote reference numbers to be enclosed in square brackets.

    My solution, which seemed to meet their needs, was a macro that searched on the Endnote Reference style, both in the main document and in the endnotes, and placed the square brackets around the reference. Before adding the square brackets the macro checked that they were not already present.

    I could send you the code if you are interested, but I am not proud enough of my code to post it here.

  5. #5
    Ursusmaximus
    Guest

    Re: Square brackets round endnote numbers (W97 SR-1)

    Robin,

    Thanks for getting back on this. I eventually decided to do a search and replace operation, first removing all square brackets (as some endnotes already had them, but we hadn't used them for anything else), then searching for
    ^e
    and replacing with
    [^&]
    which seems to have worked.

    But I'd still be interested in seeing your code, as my colleague has another similar report to deal with this afternoon or Monday, and doing it via VBA may be more efficient. Also, some of our other docs may use square brackets for other things, so simply deleting them all before inserting them round the endnote references may not always be practical -- a macro that checks first could be handy.
    In any case, this is not going to be the last time we do such things, and I'm thinking of building up a library of reformatting macros, of which yours could perhaps be the first. <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

    Steve

  6. #6
    Lounger
    Join Date
    Jan 2001
    Location
    Milton Keynes, Buckinghamshire, England
    Posts
    48
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Square brackets round endnote numbers (W97 SR-1)

    Steve,

    I am a little dismayed at the length of this code, and no doubt more experienced Loungers will be able to tell me how to make it less verbose.

    As well as bracketing the endnote references themselves, both in the body of the document and in the endnotes, it also brackets 'note reference' fields, used to repeat the reference to an endnote. However, the code does not differentiate adequately between note reference fields used for endnotes and those used for footnotes, so if there is a mixture of both in a document, both lots of reference fields would get bracketed.

    I have attached the code (I hope).
    Attached Files Attached Files

  7. #7
    3 Star Lounger
    Join Date
    Mar 2001
    Location
    Pune
    Posts
    310
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Square brackets round endnote numbers (W97 SR-1)

    I think a simple solution for a situation where endnotes are not already there but would be created, would be to record a macro which

    (a) inserts opening and closing square brackets,
    ([img]/forums/images/smilies/cool.gif[/img] marks these brackets and applies the endnote reference style to the block,
    moves the cursor between the brackets,
    (d) inserts the endnote in the usual way

    Then, rename the macro as "InsertFootnote" and save it in the template, so that this macro will run everytime you wish to insert a footnote or endnote in a document based on this template. The name of the macro is important, as it then runs instead of the usual InsertFootnote Word command.

    This method can be used to customise the way any Word command works.

  8. #8
    Ursusmaximus
    Guest

    Re: Square brackets round endnote numbers (W97 SR-1)

    Robin,

    Many thanks for the code (yep, it attached successfully!)

    Verbose or not, it looks like it would do just what I want ... I look forward to trying it this afternoon or Monday!

    Regards,

    Steve

  9. #9
    Ursusmaximus
    Guest

    Re: Square brackets round endnote numbers (W97 SR-1)

    Rajesh,

    Thanks for the idea -- this would certainly simplify things. I'll probably go a step further and define a keyboard shortcut, as I touch type and work fastest if I don't take my fingers of the keys.

    Steve

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •