0
   

batch change tables and their captions to pictures in Ms Word

 
 
Reply 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: 1,135 • Replies: 1
No top replies

 
fankytl
 
  1  
Reply 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
 
 

Related Topics

Microsoft Word - Question by gollum
A first look at Windows 7's UI - Discussion by Robert Gentel
MSN Groups Being Moved - Discussion by edgarblythe
My Windows 10 Computer Locked - Question by nyspurss
The skype - Discussion by RexRed
 
  1. Forums
  2. » batch change tables and their captions to pictures in Ms Word
Copyright © 2019 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.03 seconds on 08/17/2019 at 04:53:22