0
   

batch change tables and their captions to pictures in Ms Word

 
 
Thu 11 May, 2017 12:57 am
hello ,

In word, table and its caption is divided. And I want to make them as one picture , so I can select and move them easily , and others can not edit my tables. So I make a screenshoot for a table and its caption to save them as one picture.

It's fine to do that with one table. But I have a lot of tables to deal with.

So I need a quick way to batch change tables and their captions to pictures in a word files . Any help will be appreciated.
  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Question • Score: 0 • Views: 4,064 • Replies: 2
Topic Closed
No top replies

 
fankytl
 
  1  
Tue 16 May, 2017 02:18 am
@RileyTutu,
hey,RileyTutu

For that , you can use VBA to do that. Try the macro below

Sub ConvertTablesToPictures()
Dim objTable As Table
Dim objDoc As Document
Dim objParagraph As Paragraph
Dim nTable As Integer

Set objDoc = ActiveDocument
nTable = 0

With objDoc
For Each objParagraph In .Paragraphs
If objParagraph.Range.Style = "Caption" Then
objParagraph.Range.Delete
End If
Next objParagraph

For Each objTable In .Tables
objTable.Rows(1).Select
Selection.InsertRowsAbove

nTable = nTable + 1

objTable.Cell(1, 1).Range.InsertAfter "Table" & " " & nTable
objTable.Cell(1, 1).Range.Style = "Caption"

objTable.Rows(1).Cells.Borders.Enable = False
objTable.Rows(1).Cells.Borders(wdBorderBottom).LineStyle = wdLineStyleSingle

objTable.Range.Select
Selection.Cut

Selection.PasteSpecial Link:=False, dataType:=wdPasteEnhancedMetafile, _
Placement:=wdInLine, DisplayAsIcon:=False
Next objTable

End With

End Sub

0 Replies
 
dyllan
 
  0  
Thu 16 Nov, 2023 02:11 pm
@RileyTutu,
same problem, thank you
0 Replies
 
 

Related Topics

 
  1. Forums
  2. » batch change tables and their captions to pictures in Ms Word
Copyright © 2024 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.05 seconds on 10/06/2024 at 01:48:21