Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.tables
[email protected] cristian.zanchetta@gmail.com is offline
external usenet poster
 
Posts: 2
Default how to export cell value outside word

Hi, I have to export the value of a cell outside word (to database)
but I didn't find anything that can help me.
I found a lot of command but none works.
For example:

ActiveDocument.Tables(1).Cell(2, 1).Range.Text

to retrieve the cell content, give me the right result but there is
one or more squares characters (it depends on cell value) added to the
number to export. This couse an incompatibility with the field of
database. Why there is those hidden characters and how can I remove
them? There is a faster way to do this?
Thank you

  #2   Report Post  
Posted to microsoft.public.word.tables
Jay Freedman Jay Freedman is offline
external usenet poster
 
Posts: 9,854
Default how to export cell value outside word

The two extra characters at the end of the string are the cell marker
(which appears as the single character ¤ when you display nonprinting
characters). Every cell contains at least the cell marker, even when
it appears to be empty.

You can get the string you want with this code:

st = ActiveDocument.Tables(1).Cell(2, 1).Range.Text
st = Left(st, Len(st) - 2)

or with this code:

Dim rg As Range, st As String
Set rg = ActiveDocument.Tables(1).Cell(2, 1).Range
rg.MoveEnd wdCharacter, -1
st = rg.Text

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.

On Sat, 15 Sep 2007 17:05:59 -0700,
wrote:

Hi, I have to export the value of a cell outside word (to database)
but I didn't find anything that can help me.
I found a lot of command but none works.
For example:

ActiveDocument.Tables(1).Cell(2, 1).Range.Text

to retrieve the cell content, give me the right result but there is
one or more squares characters (it depends on cell value) added to the
number to export. This couse an incompatibility with the field of
database. Why there is those hidden characters and how can I remove
them? There is a faster way to do this?
Thank you

  #3   Report Post  
Posted to microsoft.public.word.tables
[email protected] cristian.zanchetta@gmail.com is offline
external usenet poster
 
Posts: 2
Default how to export cell value outside word

Thank you very much! I successfully exported my data. Thanks again.

On 16 Set, 02:40, Jay Freedman wrote:
The two extra characters at the end of the string are the cell marker
(which appears as the single character ¤ when you display nonprinting
characters). Every cell contains at least the cell marker, even when
it appears to be empty.

You can get the string you want with this code:

st = ActiveDocument.Tables(1).Cell(2, 1).Range.Text
st = Left(st, Len(st) - 2)

or with this code:

Dim rg As Range, st As String
Set rg = ActiveDocument.Tables(1).Cell(2, 1).Range
rg.MoveEnd wdCharacter, -1
st = rg.Text

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ:http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.

On Sat, 15 Sep 2007 17:05:59 -0700,
wrote:

Hi, I have to export the value of a cell outside word (to database)
but I didn't find anything that can help me.
I found a lot of command but none works.
For example:


ActiveDocument.Tables(1).Cell(2, 1).Range.Text


to retrieve the cell content, give me the right result but there is
one or more squares characters (it depends on cell value) added to the
number to export. This couse an incompatibility with the field of
database. Why there is those hidden characters and how can I remove
them? There is a faster way to do this?
Thank you



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
How do I move from cell to cell iin a table column in Word 2003? MOSwannabe Tables 4 January 26th 06 10:17 PM
cell marker missing - can not type text into cell Mary Smith 360 Tables 1 December 20th 05 05:04 AM
Word count in Word table cell wrong if whole cell selected Grey Dingo Tables 10 August 7th 05 11:50 PM
RTF export from Word nickrose Microsoft Word Help 0 March 2nd 05 11:03 PM
How do I auto copy data from cell in a word table to another cell. Nev New Users 1 February 4th 05 08:51 PM


All times are GMT +1. The time now is 04:52 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"