PDA

View Full Version : Parse a table in FrontPage



WidgetBoy
03-08-2006, 03:52 PM
Hoping somebody can help.

I'm new to VBA & I've a simple task which I figure any one of you wonderful VBA gurus would know how to do...

I'm going to use Frontpage (fp) to create a html file mostly to allow a user to visually layout a table.

When they've done this I want to have them run a VBA program to parse that single table and spit out some Smalltalk code (I know...) to say the clipboard.

for each TR in the table
append this text to the clipboard: ' layout addChild: ( TR,rowNum := TRView new). '

for each TD in the TR
append this text to the clipboard:
' TR+rowNum addChild: ( TD,rowNum,colNum := TDView new).'


The idea is to generate a block of code adding 'child' TDs to their TRs.

so for a 2 column 3 row table the desired generated output would be:

"layout addChild: (TR1 := TRView new).
TR1 addChild: (TD11 := TDView new).
TR1 addChild: (TD12 := TDView new).
layout addChild: (TR2 := TRView new).
TR1 addChild: (TD21 := TDView new).
TR1 addChild: (TD22 := TDView new).
ayout addChild: (TR3 := TRView new).
TR1 addChild: (TD31 := TDView new).
TR1 addChild: (TD32 := TDView new)."


Any and all help MUCH appreciated!

Cheers,
WB

mdmackillop
03-17-2006, 01:13 PM
Hi WB
Welcome to VBAX.
I've never used FrontPage so don't know if I can assist, and I've not seen many (if any) questions relating to it. If you can post a sample file, though, I'll take a look. To post, use Manage Attachments which you'll find in the Go Advanced section.
Regards
MD