Reply
 
Thread Tools Display Modes
  #1   Report Post  
Ed
 
Posts: n/a
Default Copying text between tables using VBA

I'm trying to make sure a group of tables all have the same headers. So
after formatting one table, I'm copying all the pertinent attribute over in
a macro. The text, though, is giving me a bit of a problem - an extra
paragraph mark. I'm using
tab2.Cell(1, 1).Range.Text = tab1.Cell(1, 1).Range.Text
and always get the text plus a paragraph mark. Any suggestions that would
save me from going back to every table and deleting the paragraph mark?

Ed


  #2   Report Post  
Cindy M -WordMVP-
 
Posts: n/a
Default

Hi Ed,

I'm trying to make sure a group of tables all have the same headers. So
after formatting one table, I'm copying all the pertinent attribute over in
a macro. The text, though, is giving me a bit of a problem - an extra
paragraph mark. I'm using
tab2.Cell(1, 1).Range.Text = tab1.Cell(1, 1).Range.Text
and always get the text plus a paragraph mark. Any suggestions that would
save me from going back to every table and deleting the paragraph mark?

There is always a Chr$(13)&Chr$(7) pair of characters at the end of every
table cell. You can't get rid of them, they're part of the table structure,
and store important formatting and layout information. (Well, actually what
they store is a pointer to an internal table with the information.)

You need to trim the last two characters from any string you pick up from
Range.Text in a table cell, which you can do with a combination of the Left
and Len functions.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)

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
when i scroll after copying some text, the copied text is lost Parasuraman Microsoft Word Help 0 March 21st 05 12:25 AM
text boxes: tabbing and tables Cynthia Microsoft Word Help 3 January 15th 05 03:12 PM
Excel worksheet in Word linked text boxes Eduardo Oliveira Page Layout 0 January 5th 05 11:23 PM
Outline Renee Hendershott Page Layout 2 December 25th 04 02:49 PM
Referencing Text fields in tables BigWylie1 Tables 0 October 26th 04 08:17 PM


All times are GMT +1. The time now is 12:57 AM.

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"