View Single Post
  #2   Report Post  
Scott Bass
 
Posts: n/a
Default

Also, is there a way to format the information read in from Excel? For
example, if the cell contains 0, I might want the output to be "0.00" in one
scenario, "( 0)" in a second scenario, and "00.0 (00.0%)" in a third
scenario.

I tried adding \# "00.0" at the end of the connection string to Excel, but
that broke the read of the data from Excel.

Thanks...

"Scott Bass" usenet739_yahoo_com_au wrote in message
...
Windows XP Professional SP 2
MS Word 2003 SP1

Hi,

I'm trying to automate a word document by reading in data that gets
updated in Excel. I'm experiencing what I think might be a bug.

Try this:

* Create an Excel spreadsheet, say with a label row, 2 columns, and 3 rows
* Open MS Word
* Select Insert -- Field -- Database -- Insert Database button -- Get
Data button
* Navigate to your Excel spreadsheet, Open, select Sheet 1 (or the proper
sheet)
* Select Insert Data, check Insert Data as Field checkbox

* Now, drag the embedded table columns to widen the first column, moving
the second column to the right.
* Also, change the font of the text to some other value. Give it a
different style if you want. Change the color.

Now, RMB the field and choose Update Field. The columns will resize to
their original width, and the font reverts to the original font.

As one more test, RMB the field, chose Edit Field. Click the checkbox
Preserve formatting during updates. Repeat the above process. Same
problem. RMB again. The Preserve formatting checkbox is unchecked again.

Lastly, change the font in the Excel spreadsheet. Still doesn't work,
it's not picking up the font from the spreadsheet.

Surely this is a bug? Please please tell me this is fixed with some
service pack I can install? If M$ Word drops all formatting whenever I
update the field, my whole approach to a particular project is screwed. I
need to define Word templates which get their data from an Excel
spreadsheet, and Word needs to preserve the formatting of the text (font,
column positioning, everything but the text itself) when the Excel data
changes.

Here's hoping...

Scott