View Single Post
 
Old 12-14-2015, 02:31 AM
Jennifer Murphy's Avatar
Jennifer Murphy Jennifer Murphy is offline Windows XP Office 2007
Competent Performer
 
Join Date: Aug 2011
Location: Silicon Valley
Posts: 234
Jennifer Murphy is on a distinguished road
Default

Well, I narrowed the problem down to just a few lines of code, but I still do not understand what is happening. I created two subs: Test1 & Test2.

Running Test1 changes the behavior of the tab key so that it increases the heading level (not the list level). Note that the variable temp is not used. All that is needed is to reference the Selection.Paragraphs(1).OutlineLevel property.
Code:
  Sub Test1()
  ' This sub sets Outline View then Normal View
  ' It also changes the tab key to increase the heading level
  ' Keyboard shortcut: ACS+O
  
  Dim temp
  ActiveWindow.View.Type = wdOutlineView
  temp = Selection.Paragraphs(1).OutlineLevel
  ActiveWindow.View.Type = wdNormalView
  
  End Sub
Running Test2 restores the normal tab key behavior. In this sub, the property is referenced in an IF statement that does nothing.
Code:
  Sub Test2()
  ' This sub resets the tab key to be a tab key
  ' Keyboard shortcut: ACS+P
  
  If Selection.Paragraphs(1).OutlineLevel = 10 Then Exit Sub
  
End Sub 


Does this behave this way on anyone’s machine other than mine?

Is there a command to restore the tab behavior to be just a tab function?
Reply With Quote