I get the error on this code:
Dim TableWidth as Integer
TableWidth = Selection.Tables(1).Cell(1, 1).Width
thanks.
Have a look at the VBA Help file topic "Overflow (Error 6):
You get this error because "You attempt to use a number in a calculation,
and that number is coerced into an integer, but the result is larger than an
integer."
HTH
"jing" <ji...@hlhz.com> wrote in message
news:411b01c24804$6cfe7640$37ef2ecf@TKMSFTNGXA13...
The Width property is of type Long, not Integer. Change this line
Dim TableWidth as Integer
to this
Dim TableWidth as Long
--
Regards
Jonathan West - Word MVP
MultiLinker - Automated generation of hyperlinks in Word
Conversion to PDF & HTML
http://www.multilinker.com
Word FAQs at http://www.multilinker.com/wordfaq
Please post any follow-up in the newsgroup. I do not reply to Word questions
by email
"jing" <ji...@hlhz.com> wrote in message
news:543201c24884$4b08dc30$9ee62ecf@tkmsftngxa05...
its always dangerous using the absolute cell reference in that way. A
better way is this
Get the row's range
then use .cells(cell number)
However, your problem is porbably due to the fact you are trying to
use an Integer to do the work of a Long. .Width returns a Long so use
that datatype instead.
"jing" <ji...@hlhz.com> was spinning a yarn that went like this:
Steve Hudson -- Word Heretic, Sydney, Australia
Freelance teacher, trainer, tutor, writer, developer
Email: her...@tdfa.com Blog and FAQs: http://blog.tdfa.com
Word MVP FAQs: http://www.mvps.org/word/FAQs/index.html
You agree by writing to me personally that any material can be reused publicly unless you explicitly disclaim it. (For List and blog use.)