Home > Software engineering >  Excuse me, how many tables in word batch adjust format?
Excuse me, how many tables in word batch adjust format?

Time:11-19

Excuse me, how many tables in word batch adjust format?

CodePudding user response:

First of all, the recording macros, select a table, what do you do for a single form with record,
Then look at the generated code, basic it is a series of operations on the selection object,
Just like the following

 
Sub macro (4)
'
"Acer 4
'
'
Selection. MoveUp Unit:=wdLine, Count:=4, the Extend:=wdExtend
Selection. MoveDown Unit:=wdLine, Count:=1, the Extend:=wdExtend
Selection. Shading. Texture=wdTextureNone
Selection. Shading. ForegroundPatternColor=wdColorAutomatic
Selection. Shading. BackgroundPatternColor=- 553582746
Selection. The Font. The Name="bold"
Selection. Tables (1). Style="grid type light
"End Sub


Next, write your own macros, overall train of thought is to traverse the document around the table, and each table is selected, the repeat of a single form do,
 
Sub test ()
Dim t As Table
For Each t In Application. The ActiveDocument. All Tables In the Tables' traverse the document
T.S well 'selected form

'TODO: the single form operation record macro code post can

DoEvents
Next
End Sub

  • Related