View Single Post
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Jean-Guy Marcil
 
Posts: n/a
Default Is there an easy way to do IEEE style reference

SSK was telling us:
SSK nous racontait que :

Is there an easy way to do IEEE style references in Word? If you're
not familiar with it, you put a number in square brackets [x] next to
the citation and have a list of references at the end of the document
arranged by first appearance.

So, it's basically like endnotes, but not superscript, and in square
brackets. Is there a way to make Word automatically put square
brackets around endnote numbers?


I think you need a macro. Try this:

'_______________________________________
Sub InsertFootnote()

Dim LocCursor As Range
Dim LocCursor1 As Range

Set LocCursor = Selection.Range

With ActiveDocument.Range(Start:=ActiveDocument.Content .Start, End:= _
ActiveDocument.Content.End)
With .EndnoteOptions
.Location = wdEndOfDocument
.NumberingRule = wdRestartContinuous
.StartingNumber = 1
.NumberStyle = wdNoteNumberStyleArabic
End With
.Endnotes.Add Range:=Selection.Range, Reference:=""
End With

With Selection
.HomeKey wdLine
.MoveRight wdSentence, 1, wdExtend
.Font.Superscript = False
.HomeKey wdLine
.TypeText "["
.MoveRight wdCharacter, 1
.TypeText "]"
.EndKey wdLine
End With

With LocCursor
.InsertBefore "["
.SetRange LocCursor.Start, LocCursor.End + 1
.InsertAfter "]"
.Font.Superscript = True
.SetRange LocCursor.End, LocCursor.End
End With

Set LocCursor1 = LocCursor.Duplicate
LocCursor1.SetRange LocCursor1.End, LocCursor1.End + 1

If Not LocCursor1 = " " Then
LocCursor.InsertAfter " "
LocCursor.Font.Superscript = False
End If

End Sub
'_______________________________________

Make sure you do not change the name of the macro if you want this to happen
automatically.
If you want to have the option of inserting regular footnote *and* these
special endnotes, change the macro name and call the macro explicitly when
you need an endnote (as is, whenever you do Insert Reference...
Footnote, my macro will be automatically called).

See
http://word.mvps.org/faqs/macrosvba/CreateAMacro.htm
for help with installing/using macros from NG.


--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
ISTOO
Word MVP site:
http://www.word.mvps.org