# Word 2007 - Copy Text From Website, but remove table format?



## Anthony1uk

Hi,

This is likely a very simple problem but I have been trying to achieve this with no avail.

But I have Word 2007 and I am wanting to copy and paste to word the entire text from a webpage and have it contain all of its other text formatting (i.e Bolding, Bulletting etc). However I want to remove all of the tables structure format that websites seem to use for a page of text.

I am doing the webpage copy via simply scrolling and highlinting all of the text on the page that I need and then choosing copy and paste into word 2007.

Specifically because I wish to print out to read offline the text from a website and not waste any paper that the table format is causing.

However currently when I copy and paste the text from an entire webpage I am needing to spend some time fiddling removing all the text from inside numerous (and also invisible) tables just to get the perfect full page printout with no wastage.

Therefore can I ask is there anyway I can just copy and paste the text and have it turn out as a normal word formatted document without the tables.

I have tried interim copying from the Website > Notepad > Word 2007 and this does remove the problem with the tables being copied. However Notepad is also removing all of the needed text formatting such as Bullets and Bolding.

So are there any other easy suggestions to achieve this.

Thanks
Anthony


----------



## Baldspot

Copy the web page, paste into Word using *Edit / Paste Special / Rich Text Format*

This will give you a table but not a bunch of HTML stuff.

Then select the table and use *Table / Convert / Table To Text* 

You will still have some clean up to do but hopefully this will be much less work for you.


----------



## David M C

This quick macro will remove the table format - it's set up in a loop for 399 tables but you can adjust that by changing the counter numbers. 

' TableToText Macro
Dim Check, Counter
Check = True: Counter = 0 ' Initialize variables.
Do ' Outer loop.
Do While Counter < 400 ' Inner loop.
Selection.GoTo What:=wdGoToTable, Which:=wdGoToNext, Count:=1, Name:=""
Selection.Find.ClearFormatting
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Rows.ConvertToText Separator:=wdSeparateByTabs, NestedTables:= _
 True
Counter = Counter + 1 ' Increment Counter.
If Counter = 399 Then ' If condition is True.
Check = False ' Set value of flag to False.
Exit Do ' Exit inner loop.
End If
Loop
Loop Until Check = False ' Exit outer loop immediately.
End Sub


----------



## Anthony1uk

Thanks for this David.

I had totally forgot I had started this topic.

My need for it has lapsed. But I may possibly need it again in the future.


----------



## Andre_

Thanks David, I found this through a Google search and it works well for me. I registered here just to say I appreciate it.


----------



## gmichaels

Thanks, David! Finally, a solution that works. I've been looking for this for a long time. It's too bad, though, that many people don't know how to access the VB editor in Word. I will share this macro with those people who have this same problem copying and pasting Web pages into Word to save the information.


----------

