Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 12-14-2015, 02:31 AM
Jennifer Murphy's Avatar
Jennifer Murphy Jennifer Murphy is offline Tab character causes style change to Heading 4 after macro Windows XP Tab character causes style change to Heading 4 after macro Office 2007
Competent Performer
Tab character causes style change to Heading 4 after macro
 
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
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Tab character causes style change to Heading 4 after macro Macro to change style name with " in it gundas Word VBA 3 04-02-2013 06:20 AM
Change single character in PPT to another font macro rtwwpad PowerPoint 1 01-19-2013 05:08 PM
Tab character causes style change to Heading 4 after macro Macro to replace one specific heading style with another ubns Word VBA 44 09-04-2012 08:17 PM
Change the leading of a character style??? Char t Word 1 11-05-2011 01:18 PM
Character style stripped while applying paragraph style sams_gates Word 0 08-29-2009 02:03 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:54 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft