code it

macro to select only text from table cell in Word

When I used to copy content from Word from selected table cell into PowerPoint the para formatting used to get lost. To retain the para formatting only the text from the table cell should be copied.

Below is the macro on how to select only the text from a selected table cell.

Sub select_text()
Dim oDoc As Document
Dim oRng As Range
Set oDoc = ActiveDocument
Set oRng = Selection.Cells(1).Range.Paragraphs(1).Range
oRng.End = oRng.Cells(1).Range.End - 1
End Sub


April 11, 2011 - Posted by | VBA, Word

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: