"Find " table?

V

Vijay J.

I would like to convert all my tables to text. I use
tables for holding Fig+caption and Equation+caption. Is
there a way to "Find" tables in a document just like we
normally find anything else (characters, font etc)? (If
yes, then I have in mind the approach to use a macro to
convert all tables to text). Or I need to manually find
each table, select it and convert it to Text? (Word 2000).
 
G

Greg

Something like:

Sub ConvertTableToText()

Dim oTbl As Table

For Each oTbl In ActiveDocument.Tables
With oTbl
.ConvertToText Separator:=wdSeparateByParagraphs
End With
Next
End Sub
 
V

Vijay J.

Thanks Greg, it works!

I was now wondering if there is a way to selectively
convert tables to text, as there might be a few tables
which I don't like to convert. Also, I usually record
macros from "Tools>macro>record new macro", i.e. by using
keyboard shortcuts for operations, as I am not very
familiar with VB etc. So, is it possible to "find" a
table somehow? I can then write (..infact record) a macro
to convert the selected table to text, this will give me
an opportunity to skip a table found if I don't want to
convert it, and go to next find.
 
G

Greg

Vijay,

Something like:

Sub ConvertSelectiveTablesToText()
Dim rngstory As Range
Dim Convert As VbMsgBoxResult
Dim oTbl As Table

MakeHFValid
For Each rngstory In ActiveDocument.StoryRanges
Do
For Each oTbl In rngstory.Tables
oTbl.Range.Select
Convert = MsgBox("Do you want to convert this
table?", vbYesNo, "Table Found")
If Convert = vbYes Then
With oTbl
.ConvertToText Separator:=wdSeparateByParagraphs
End With
End If
Next
Set rngstory = rngstory.NextStoryRange
Loop Until rngstory Is Nothing
Next

End Sub
 
D

Dayo Mitchell

Though's Greg's solutions will be more efficient, you can in fact use the
Browse function to browse by tables.

Click on the small circle between the two double arrows at the bottom of the
vertical scroll bar. It will produce a menu of icons, as you move over the
icons, the top bar will read "browse by heading", another "browse by
section", another "browse by table", etc. After setting the "browse by
table," click on the double arrows for Next Table or Previous Table.

You can make NextTable into one command by recording a macro of yourself
doing this, then linking the macro to a shortcut key or icon.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top