Dim cellText As Range
Set cellText = ActiveDocument.Tables(1).Cell(2, 2).Range
cellText.End = cell.Text.End - 1
Please respond to the newsgroups for the benefit of others who may be
Hope this helps
Doug Robbins - Word MVP
----- Original Message -----
Sent: Friday, May 30, 2003 1:02 PM
Subject: RE: Remove Hidden Characters
> Thanks for the suggestion... However, what you are suggesting doesn't
> to be working for me.
> Here is a example of what I'm trying to do.
> Sub table_cell_text()
> Dim cellText As String
> ActiveDocument.Tables(1).Cell(2, 2).Select
> cellText = Selection.Text
> End Sub
> cellText has hidden characters at the end and I need to remove them
> How do I make my selection a "range" as you suggest?
> I tried "Selection.Range.End -1" and I get a number returned based on
> count I'm guessing.
> Could your provide a bit more guidance? Thanks.
> -----Original Message-----
> Sent: Thursday, May 29, 2003 4:43 PM
> To: Brian Stigler
> Subject: Re: Remove Hidden Characters
> Hi Brian,
> If by hidden characters you mean the end of cell marker, set a range equal
> to the range of the cell and then use
> yourcellrange.End = yourcellrange.End - 1
> Please respond to the newsgroups for the benefit of others who may be
> Hope this helps
> Doug Robbins - Word MVP
> > I've got a word macro that compiles the text of several table cells.
> > problem is that the "selection" method grabs not only the cell text, but
> > also all of the hidden characters in that cell. I would like to find a
> > to remove these hidden characters. I'm wondering if there is a built
> > function to remove them. Or do I need to write a stripping routine that
> > checks for their presence and remove them as required?
> > Thanks,
> > Brian