Hi Rich. Did I ever send you a signed book? I have a new one coming out in January and I will be happy to send you that one also. The macro you wrote has served me quite well since July 2014. I am anxious to move to Word for Mac 2016 but have been held back
because EndNote was not compatible. Thomson Reuters has just released a public beta that supports W16. The new Word and EndNote work well, but the macro does not. I would not expect you to remember but there are actually two macros. One inserts the endnote
and the other returns the cursor back to where you inserted the footnote. The second one works fine. The first one inserts the footnote and then pops up a message saying "Invalid procedure call or argument". When I click Ok the macro continues to the insertion
point in the Endnotes. It stops just short of inserting the selected citation. I ran Word 2011 and confirmed that both macros work fine. I would appreciate it if you could take a look at the macro. Here it is....
Sub InsertEndNotePart1()
'Authored by Richard V Michaels
'Great Circle Learning, Marco Island, Florida
'July 18, 2014, Revised August 19, 2014
On Error
GoTo ErrHandler
If ActiveDocument.Bookmarks.Exists("myEndNoteBmk")
Then ActiveDocument.Bookmarks.Item("MyEndNoteBmk").Delete
With ActiveDocument.Endnotes
.Location = wdEndOfDocument
.NumberingRule = wdRestartContinuous
.StartingNumber = 1
.NumberStyle = wdNoteNumberStyleArabic
End
With
Word.Selection.Collapse Word.WdCollapseDirection.wdCollapseEnd
ActiveDocument.Bookmarks.Add "MyEndNoteBmk", Word.Selection.Range
Word.Selection.Endnotes.Add Word.Selection.Range, Reference:=""
'the EndNote reference is now inserted and the editing insertion point is now at the end of the document
'since the VBA SendKeys command does not work in Office 2011 I had to resort to AppleScript
Dim MyScript
As String
MyScript = MyScript & "tell application ""System Events""" & Chr(13)
MyScript = MyScript & "keystroke ""f""" & " using (option down, command down)" & Chr(13)
'I assigned a custom keystroke to Option+Control+e that would insert a test AutoText
'If EndNote X7 overrides that built-in keystroke maybe it will work as you desire
MyScript = MyScript & "delay 0.1" & Chr(13)
MyScript = MyScript & "end tell" & Chr(13)
ActiveDocument.Activate
MacScript (MyScript)
'this executes the above MacScript
ErrHandler:
Select Case Err.Number
Case 0
'all okay
Case Else
MsgBox Err.Description
Err.Clear
End
Select
End Sub
John
--
Dr. John R Patrick
Mobile: [Phone number removed by moderator for privacy]
Web: attitudellc.org
Wikipedia: en.wikipedia.org/wiki/John\_R.\_Patrick
FB: facebook.com/john.patrick.3110
Tw: @johnrpatrick
New book: Health Attitude: Unraveling and Solving the Complexities of Healthcare
Anyone can follow my postings about healthcare and technology at attitudellc.org. To receive a weekly summary of things I write about, please visit
http://attitudellc.org/?keep-me-posted. It would be a pleasure to have you join my list. I am always open to feedback at
\*\*\* Email address is removed for privacy \*\*\*