![]() |
|
#1
|
|||
|
|||
|
Is it possible to make a macro that goes through all of the word files in a folder and set all tables in each of the word documents to ‘allow row to break across pages’ ? Many thanks |
|
#2
|
||||
|
||||
|
For example:
Code:
Sub UpdateDocuments()
Application.ScreenUpdating = False
Dim strDocNm As String, strFolder As String, strFile As String
Dim wdDoc As Document, wdTbl As Table
strFolder = GetFolder
If strFolder = "" Then Exit Sub
strFile = Dir(strFolder & "\*.doc", vbNormal)
strDocNm = ThisDocument.FullName
While strFile <> ""
If strFolder & "\" & strFile <> strDocNm Then
Set wdDoc = Documents.Open(FileName:=strFolder & "\" & strFile, AddToRecentFiles:=False, Visible:=False)
With wdDoc
For Each wdTbl In .Tables
wdTbl.Rows.AllowBreakAcrossPages = True
Next
.Close SaveChanges:=True
End With
End If
strFile = Dir()
Wend
Set wdDoc = Nothing
Application.ScreenUpdating = True
End Sub
Function GetFolder() As String
Dim oFolder As Object
GetFolder = ""
Set oFolder = CreateObject("Shell.Application").BrowseForFolder(0, "Choose a folder", 0)
If (Not oFolder Is Nothing) Then GetFolder = oFolder.Items.Item.Path
Set oFolder = Nothing
End Function
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Create rule to move email from archive folder to senders name folder | bigduke70 | Outlook | 0 | 03-09-2019 08:33 AM |
| Hilight Parent Folder when Child folder is allocated a new email | brucemc777 | Outlook | 2 | 11-09-2016 09:14 AM |
| I have an example but I can't modify it as I want! | kareemva | Excel Programming | 0 | 02-27-2016 11:48 PM |
How to modify and/or delete TOC
|
Nathan8752 | Word | 10 | 11-13-2015 01:20 PM |
| How to constantly and automatically copy the contacts from a shared folder to my private folder? | Paulo | Outlook | 0 | 08-16-2015 12:06 PM |