Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.tables
Hal Hal is offline
external usenet poster
 
Posts: 27
Default Converting Multiple Tables to Text

If one has a document that is composed of multiple tables is there an easy
way to select the whole document and convert all tables to text at once or do
you have to convert each table individuallY? Thanks.
  #2   Report Post  
Posted to microsoft.public.word.tables
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Converting Multiple Tables to Text

Use the following code in a macro

Dim i As Long
With ActiveDocument
For i = .Tables.Count To 1 Step -1
.Tables(i).ConvertToText
Next i
End With

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"Hal" wrote in message
...
If one has a document that is composed of multiple tables is there an easy
way to select the whole document and convert all tables to text at once or
do
you have to convert each table individuallY? Thanks.



  #3   Report Post  
Posted to microsoft.public.word.tables
zoobree zoobree is offline
external usenet poster
 
Posts: 1
Default Converting Multiple Tables to Text

I tried the code you suggested but it does nothing to my document. I suspect
it is because all of the tables are in the headers, there are multiple
sections in the document, and multiple headers in each section. If that's
the problem, is there some way I can create a nested loop to convert all of
the tables in all of the headers to text?

"Doug Robbins - Word MVP" wrote:

Use the following code in a macro

Dim i As Long
With ActiveDocument
For i = .Tables.Count To 1 Step -1
.Tables(i).ConvertToText
Next i
End With

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"Hal" wrote in message
...
If one has a document that is composed of multiple tables is there an easy
way to select the whole document and convert all tables to text at once or
do
you have to convert each table individuallY? Thanks.




  #4   Report Post  
Posted to microsoft.public.word.tables
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Converting Multiple Tables to Text

If there is just one table in each header and it is in the Primary Header,
then the following should do it:

Dim i As Long
With ActiveDocument
For i = 1 To .Sections.Count
.Sections(i).Headers(wdHeaderFooterPrimary).Range. Tables(1).ConvertToText
Next i
End With

If there is more than one table, you will need to iterate through them in
the same way as the previous macro

If there a First Page Headers, you will need to add another command

..Sections(i).Headers(wdHeaderFooterFirstPage).Ran ge.Tables(1).ConvertToText

Before the Next i

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"zoobree" wrote in message
...
I tried the code you suggested but it does nothing to my document. I
suspect
it is because all of the tables are in the headers, there are multiple
sections in the document, and multiple headers in each section. If that's
the problem, is there some way I can create a nested loop to convert all
of
the tables in all of the headers to text?

"Doug Robbins - Word MVP" wrote:

Use the following code in a macro

Dim i As Long
With ActiveDocument
For i = .Tables.Count To 1 Step -1
.Tables(i).ConvertToText
Next i
End With

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"Hal" wrote in message
...
If one has a document that is composed of multiple tables is there an
easy
way to select the whole document and convert all tables to text at once
or
do
you have to convert each table individuallY? Thanks.






  #5   Report Post  
Posted to microsoft.public.word.tables
Hal Hal is offline
external usenet poster
 
Posts: 27
Default Converting Multiple Tables to Text

Doug -

I created the macro in Visual Basic. When I ran it I received the error:

"Run-time error '424':
object required"

I clicked debug and it highlighted the line in the macro beginning "For i ="

I typed just as you said, so I am not sure what is wrong. Any thoughts?

Thanks for your assistance.
Hal

"Doug Robbins - Word MVP" wrote:

Use the following code in a macro

Dim i As Long
With ActiveDocument
For i = .Tables.Count To 1 Step -1
.Tables(i).ConvertToText
Next i
End With

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"Hal" wrote in message
...
If one has a document that is composed of multiple tables is there an easy
way to select the whole document and convert all tables to text at once or
do
you have to convert each table individuallY? Thanks.




Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Header with picture or text box Scott Page Layout 15 April 28th 23 02:52 AM
Creating dynamic cross reference links in a Word document torajudo Microsoft Word Help 5 April 27th 23 08:57 PM
multiple tables same text Stam Tables 1 August 22nd 06 01:44 PM
autoshape text wrapping cayce Page Layout 6 June 16th 06 09:42 PM


All times are GMT +1. The time now is 12:58 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"