This component will be used to parse some prepared Office templates (Word, Excel and PowerPoint files), recognize certain special text “patterns” inside the documents, substitute these “patterns” with the new values (insert either text replacing the “pattern” or a metafile or bitmap picture which replaces some “auto-shape” placeholder having the “pattern” inside its text section).
Two properties will specify the input and output files (full path). The component will have some events, which trigger during the input file parsing – the recognized “pattern” will be passed as a parameter to the event procedure, and the substitution value will be returned by this event handler. Event procedure which processes auto-shape replacement will have to pass the dimensions of the auto-shape rectangle in parameters, as well as the found “pattern” text.
Phase II of the component development (separate project) may include the following enhancement:
- one of the recognized “patterns” can be used in a table cell. The event handler will have to pass the dimensions of the table as parameters (if this is not too difficult) and accept the “array of values” to fill the entire (or part of) table. The table is fully created and formatted in the original document template.
- one of the recognized “patterns” is supposed to be used within the table context. The event handler may return some “array” of values, which have to fill the table. The complexity here is that although table in the template may be represented by a single or a few cells (one row and one or a few columns) – the table will have to be appropriately extended to include the actual data returned by the event procedure (array representing some number of rows and columns).