Macro to insert an endnote and an EndNote X7 citation

Anonymous
2014-07-17T19:24:44+00:00

I am working on a 200-300 page book using EndNote x7 and Chicago endnotes formatting style. My Notes will be at the end of the book, not at end of a page or chapter. The process works fine but is not productive. For example, if I am editing the document and need to add a new citation on page 3, I do the following:

  1. Insert footnote/endnote on the page I am editing, say page 3
  2. Insert selected citation at end of document
  3. Scroll back to page 3 to continue editing.

What I propose to do is create a macro that has three parts: 

1. Prior to inserting a footnote, insert a bookmark named TEMP

  1. Insert the selected citation using Word/Tools/EndNote7/Insert selected citation
  2. Edit/Find/Goto/TEMP

I created the macro, but I cannot get it to work. Is what I am trying to do reasonable and doable? It seems simple, but....

Microsoft 365 and Office | Word | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
Answer accepted by question author
Anonymous
2016-01-03T19:22:44+00:00

Everything is working exactly as it should. Thanks so much for the assistance. Here are the changes I made:

A. Updated Word to 15.17.1

B. Changes suggested by Thomson Reuters support as follows:

  1. Quit Word.
  2. Browse to this folder on your computer: “Hard Drive Name]/Library/Application Support/Microsoft/ Office365/User Content/Startup/Word.” The folders name may vary depending on your system.
  3. Delete the “EndNote CWYW Word 2016.bundle” file if it is still present.
  4. Hold down the "option" key on your keyboard and go to the "Go" Menu and choose "Library". Go to Users:[your login name with the house icon]:Library:Application Support:EndNote.
  5. Delete “EndNote Cwyw Commands.dotm” and “EndNote Online Cwyw Commands.dotm” if present.
  6. Start the EndNote X7 Mac Beta 2. Please verify this is beta 2 by going to the EndNote menu and selecting About EndNote. The version should read “EndNote X7.5p2 (Bld 10976).
  7. Go to the EndNote menu and select "Customizer."
  8. Check the box in front of the "Cite While You Write" option. Click next until the Customizer is finished.
  9. Open a library in the EndNote X7.5 Beta.
  10. Open Word 2016 and check the Ribbon for EndNote X7.

I also rename the Applescript from Option+Control+f to Option+Command+f.

Rich, thanks very much for your great efforts in developing the macro and Applescript. This solution is a nice productivity booster for anyone writing long documents such as books or dissertations.

Was this answer helpful?

0 comments No comments
Answer accepted by question author
Anonymous
2015-12-18T23:19:50+00:00

The issue is this piece of code:

 '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

Under the new "sandboxing" rules of Apple if you want to be in their store with your "APP" you have to play by their ever changing hedonistic rules. Microsoft has decided to be their BITC@!

As I said previously, I can't take this on right now, in fact I'm only visiting the forum when I need a distraction from what is turning out to be a full time job trying to make Office 2016 for the Mac VBA work for everyone by reporting issues I'm finding directly to the product team. Right now I don't think I'm one of the more popular MVP's in their address book. :-)

What is required to get this working is someone to investigate AppleScriptTask, and figure out how to write and install the script into your machine and then interface it with this VBA code.

And no Dr. John, you never did send me a free copy of your book and I'm not about to pay for one, so... :-)

Was this answer helpful?

0 comments No comments

50 additional answers

Sort by: Oldest
  1. Anonymous
    2015-03-19T01:04:57+00:00

    Hi John,

    Congratulations and thanks for letting me know. I will pickup the Kindle edition when it's released.

    I also maintain a library at my office of signed copies of books from authors I know. Yours would be a nice edition. You can get my address from the Contact Us link on my website.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2015-04-03T02:15:14+00:00

    I made a note to remind you when my new book became available on Kindle. Today was the day! The 377 bibliographic citations were made easier because of your macro, so thank you once again. The book is at http://www.amazon.com/dp/B00VJ2B7RI

    John

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2015-12-11T23:44:07+00:00

    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 \*\*\*

    Was this answer helpful?

    0 comments No comments