![]() |
#1
|
||||
|
||||
![]()
I have two basic questions:
The one I am struggling with at the moment is Alt+o (lowercase letter "o", for outline, not zero). It toggles the "view" between normal and outline view at the level of the line where the cursor is. If the cursor is on a level 3 heading, it will toggle between normal view and collapsing all headings of level 3 or greater. I have had this shortcut for so long that I completely forgot what it is assigned to. When I went to File | Options | Customize | Customize and typed Atl+o into the "Press new keyboard shortcut" box. It showed nothing, which cannot be right since I use this all the time. After scratching my head, I remembered that I had written a macro do to this. I've included the code below. So,
Code:
Sub MyOutlineLevel() 'Call MsgBox("ActiveWindow.View = " & ActiveWindow.View & vbCrLf _ ' & "Selection.Paragraphs(1).OutlineLevel = " _ ' & Selection.Paragraphs(1).OutlineLevel) Dim DocLayout 'The document layout (view) Dim ParOutline 'The paragraph outline level (1-9 + 10 (=Bodytext)) 'DocLayout = ActiveWindow.View.Type DocLayout = ActiveWindow.View ParOutline = Selection.Paragraphs(1).OutlineLevel Select Case DocLayout 'Check the layout (view) Case wdNormalView, wdPrintView 'If Normal or Page (print) view, If ParOutline = 10 Then 'If BodyText paragraph, Exit Sub 'Do nothing Else 'Else, must be a heading ActiveWindow.View.ShowHeading ParOutline 'Show headings only up to that level End If ActiveWindow.View.Type = wdOutlineView 'And switch to Outline view Case wdOutlineView 'If Outline view, ActiveWindow.View.ShowAllHeadings 'Show everything ActiveWindow.View.Type = wdNormalView 'And switch back to Normal view Case Else 'For any other view, Exit Sub 'NOP End Select End Sub |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Importing Macros from 2007 with keyboard shortcuts | gyro2222 | Word VBA | 19 | 03-02-2015 09:33 AM |
![]() |
Jennifer Murphy | Word | 5 | 12-10-2014 07:01 AM |
Is there a way to list all keyboard shortcuts? | Jennifer Murphy | Word | 1 | 08-02-2012 01:48 PM |
![]() |
martinlest | Outlook | 1 | 06-10-2012 09:49 PM |
Impermanent keyboard shortcuts | Subligaria | Word | 2 | 11-01-2011 12:41 PM |