I wrote a simple loop to delete all styles besides "Normal" from a users workbook. But certain rogue styles caused the loop to crash although the user reported that he could delete them manually.
So I thought simple, I'll use Sendkeys....
The weird thing is that I can't get the delete to work once I raise the style dialog box.
The first style in the dropdown box is "Normal" and all the other styles are above so I use {UP 2} to grab the next style. Then it doesn't work as expected..............
Application.SendKeys ("%OS{UP 2}%M")
'correctly opens up modify for the desired style as does
Application.SendKeys ("%OS{UP 2}{TAB}~")
BUT
Application.SendKeys ("%OS{UP 2}%D")
'does not delete the selected style, nor does
Application.SendKeys ("%OS{UP 2}{TAB 2}~")
' This one opens up merge, even though merge is 3 manual tabs not 2
Any ideas?
Cheers
Dave