#1
|
|||
|
|||
Cursor not showing up when running footnote macro
Hey guys, I've been using this macro forever in Mac 2011 to insert specific formatted footnotes. It does not work properly in Mac 2016 when I run the macro with a keyboard shortcut-the cursor does not show up anywhere until you click the page somewhere. However when you run the macro from the visual editor it works like it should. Here's the code- Code:
Sub InsertFootnote() ActiveDocument.Footnotes.Add Range:=Selection.Range With Selection .Paragraphs(1).Range.Font.Reset .Paragraphs(1).Range.Characters(2) = "" .InsertAfter ". " & vbTab .Collapse wdCollapseEnd Selection.MoveLeft Unit:=wdCharacter, Count:=4 Selection.TypeText Text:=vbTab Selection.MoveRight Unit:=wdCharacter, Count:=4 End With End Sub |
#2
|
||||
|
||||
With the code you're using, the insertion point should show up in the footnote, not in "the page somewhere". Try:
Code:
Sub InsertFootnote() ActiveDocument.Footnotes.Add Range:=Selection.Range With Selection.Paragraphs.Last.Range .Font.Reset .Characters.Last.Previous.Text = ". " & vbTab .Characters.Last.Previous.Select End With Selection.Collapse wdCollapseEnd End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
Thanks Paul, always something to learn from the master. It still does the same thing with the new code. I'm thinking that this is a bug in the Mac 2016 version. When you run the code from within the visual editor it works like it always does-the cursor flashes at the point of typing in the footnote area. Not so when you use a keyboard shortcut, the cursor appears nowhere, you have to click on the doc somewhere. I'll have to get in touch with MS.
P.S. When I run either code in Windows 7 or 8 with Word 2010 or 2013 it works like it should. Weird- |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Footnote extraction macro [Why is this macro so slow? / anyway to make it faster?] | Le_Blanc | Word VBA | 10 | 03-22-2021 11:38 AM |
Macro not running on exiting legacy drop down menu. | supremegrandruler | Word VBA | 5 | 12-11-2014 11:14 PM |
issue in running macro in mac | expert4knowledge | Word VBA | 5 | 08-13-2014 02:33 PM |
Macro to find text only footnote numbers | TimFromPhx | Word VBA | 7 | 04-10-2014 07:05 PM |
Running a Macro in a protected form | yessmarie | Word VBA | 1 | 05-25-2012 12:04 AM |