PDA

View Full Version : Solved: Creating formula's and inserting them into word tables



sandam
03-14-2005, 08:54 AM
I'd like to know if its possible to use formula's like you do in excel but with word tables and if said formulas can be created/executed using macros. It needs to be word tables however (I cant insert the excel sheet into the doc - not allowed to)

I ask this because I'm currently working on converting our old billing template from WordPerfect 9 into Word 2003 and the main problem is that after the old macro had run its calcs, you couldn't recalculate the bill values automatically if you changed them. If I can do it using formulas that will auto update then its all gravy. if not I'm stuck writing some hectic array code and fiddling with table end of cell chars again (I've been fiddling with this one around other easier template conversions and now its the main one I have to work on).

Thanks in advance
Andrew;?

TonyJollans
03-19-2005, 08:12 AM
Hi Andrew,

You can add Fields in Word Table Cells which contain formulae referencing other Cells (or even other Tables).

You can add them via code if you want.

You can update Fields in code.

You can also use FormFields, which work slightly differently, but what you want should be do-able.

I'm not sure how to be more specific. Perhaps if you could post a specific example I could explain exactly what was needed so you could see how it was done.

sandam
03-19-2005, 09:30 AM
Thanks Tony. that explains quite a bit. I basically want to set up a table in Word that will calculate values for a bill. i was hoping to get away with as little coding as possible this time because I've done it once before and the module was a mile long (and thats with reusable code pieces. I've been working on it for a while now and i see where I went wrong so, I'll stick to the coding instead. thanks again.

andrew;?