Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-29-2017, 10:23 AM
suntop suntop is offline table row create folder Windows 8 table row create folder Office 2013
Novice
table row create folder
 
Join Date: Oct 2017
Posts: 1
suntop is on a distinguished road
Default table row create folder

hello everyone,

I have a word document that contains a table. The table has several columns and many rows. What I am trying to do is make word creates a folder automatically using the text in a row (spanning over several columns) and I want this to happen automatically (maybe when the user leaves the row ? or perhaps when he/she hits the save button ?). I used vba in access before, but I have never used it in word so I am a bit confused. Help please ...
Reply With Quote
  #2  
Old 10-29-2017, 01:49 PM
macropod's Avatar
macropod macropod is offline table row create folder Windows 7 64bit table row create folder Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
create rule to copy sent items to specified folder shmu Outlook 0 12-15-2015 04:08 AM
table row create folder Mail merge from excel - need to create sheets and create a table bluenosebex Mail Merge 5 08-02-2015 05:34 PM
Folder I didn't create (named after password)? Peewiglet Outlook 0 03-27-2014 02:15 PM
How to create a system folder with VB macro? Joe Patrick Word VBA 4 12-17-2011 02:04 PM
Cannot create a public folder? gfkbob Outlook 0 01-07-2010 07:18 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:36 PM.


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