Y
Yobbo
Hi All
Don't know how to best explain this, so I hope my ramble makes sense!!
Basically I've done a VB / Access DB app, which sends data to a Word Doc
template using a Word object reference and Bookmarks for the actual
placement.
How I've done it is get all the relevant data into an array and then poke
these values into the relevant bookmarks. In essence I have a word doc with
one big table on it and a bookmark in each cell of the table. I run through
the bookmarks and drop in the text (actually pupil names) where appropriate.
This all works fine apart from one thing. I need to apply formatting to
these pupil names such as background colour, text colour, bold, italic,
underline, etc and this formatting can be unique for each name.
Because you might have say 9 names (carriage return after each so they
appear on a line by themselves) in 1 cell and each of these names might have
different colouring/styling I can't do a simple blanket formatting in the
cell as a sort of 2nd pass after the text is in. I really need the ability
to do something like HTML, eg:
<redbg> & strPupilName1 & <redbg>
<bold> & strPupilName2 & <bold>
etc... etc...
or something to that effect.
Is this possible in the VBA / object ref method that I'm using or have you
got to go the:
ActiveDoc......background.color = red << I know the syntax is probably
wrong haven't looked it up
now poke the one pupil name onto the bookmark
ActiveDoc......background.color = black << I know the syntax is probably
wrong haven't looked it up
ActiveDoc......background.style = bold << I know the syntax is probably
wrong haven't looked it up
now poke the 2nd pupil name onto the bookmark
etc... etc...
Any ideas?
Thanks
Don't know how to best explain this, so I hope my ramble makes sense!!
Basically I've done a VB / Access DB app, which sends data to a Word Doc
template using a Word object reference and Bookmarks for the actual
placement.
How I've done it is get all the relevant data into an array and then poke
these values into the relevant bookmarks. In essence I have a word doc with
one big table on it and a bookmark in each cell of the table. I run through
the bookmarks and drop in the text (actually pupil names) where appropriate.
This all works fine apart from one thing. I need to apply formatting to
these pupil names such as background colour, text colour, bold, italic,
underline, etc and this formatting can be unique for each name.
Because you might have say 9 names (carriage return after each so they
appear on a line by themselves) in 1 cell and each of these names might have
different colouring/styling I can't do a simple blanket formatting in the
cell as a sort of 2nd pass after the text is in. I really need the ability
to do something like HTML, eg:
<redbg> & strPupilName1 & <redbg>
<bold> & strPupilName2 & <bold>
etc... etc...
or something to that effect.
Is this possible in the VBA / object ref method that I'm using or have you
got to go the:
ActiveDoc......background.color = red << I know the syntax is probably
wrong haven't looked it up
now poke the one pupil name onto the bookmark
ActiveDoc......background.color = black << I know the syntax is probably
wrong haven't looked it up
ActiveDoc......background.style = bold << I know the syntax is probably
wrong haven't looked it up
now poke the 2nd pupil name onto the bookmark
etc... etc...
Any ideas?
Thanks