Thread: [Solved] table row create folder
View Single Post
 
Old 10-29-2017, 01:49 PM
macropod's Avatar
macropod macropod is online now Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

The simplest approach may be to intercept Word's Document_Close event, but you'd need to supply the logic for which rows to process.

Although Word has a 'Selection Change' event that you might be able to leverage, it fires for every selection change, so you'd need to code it so that it only does anything under the appropriate conditions. It also entails the complications of creating a class module and event procedure. For more, see: https://wordmvp.com/FAQs/MacrosVBA/AppClassEvents.htm
Your code might look like:
Code:
Private Sub oApp_WindowSelectionChange(ByVal Sel As Selection)
Application.ScreenUpdating = False
With Sel
  'Do your processing here
End With
Application.ScreenUpdating = True
End Sub
Do note, too, that you'd also need to code for the processing to be based on the last cell/row previously selected.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote