![]() |
|
#1
|
|||
|
|||
![]()
Next time, please try to fully define your requirements up front?
Code:
Sub ScratchMacro() 'A basic Word macro coded by Greg Maxey Dim oFN As Footnote Dim oRng As Word.Range Dim strText As String strText = Selection.Text If Left(strText, 1) Like "[!?,.;:]" Then strText = Left(strText, Len(strText) - 1) End If Set oFN = Selection.Range.Footnotes.Add(Selection.Range, , strText & ": ") Set oRng = oFN.Range oRng.MoveEnd wdCharacter, -2 oRng.Font.Italic = True oRng.Collapse wdCollapseEnd oRng.Move wdCharacter, 2 oRng.Select End Sub |
#2
|
|||
|
|||
![]()
Thanks, Greg! I know -- it's just that I was trying to figure out the additional bits for myself, but obviously didn't do very well with that plan! This is perfect, though, and helps me see exactly how it should be done.
|
#3
|
|||
|
|||
![]()
Apologies for resurrecting this thread. This is almost the macro I need also, but I need endnotes instead of footnotes, and I need the page number of the initial selection to be put before the selected text in the endnote.
From working with this, it looks like I can just change the footnote references to endnote, but how do I put the page number of the selection in the footnote? Quote:
|
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
YooNaa Kim | PowerPoint | 1 | 06-17-2012 12:04 PM |
![]() |
blukava | Word VBA | 7 | 05-27-2012 02:43 PM |
Macro to Insert Text Into Cells Having Multiple Lines | revans611 | Excel Programming | 4 | 10-24-2011 10:15 AM |
![]() |
Natasha | Excel | 1 | 09-25-2011 12:59 PM |
![]() |
bonanzajellybean | Word | 1 | 05-31-2011 03:31 PM |