A
Al & Cay Grant
Hiya Folks,
I have a form that consists of mainly text boxs and have been using
Bookmarks
(which happen to be inside tables) to get the data inserted into the
template in the right place.
However I have introduced a multi-selectable listbox. The user can select
one or
more entry in the list box. The problem with this is that I can insert the
first selection
at a bookmark, but cant have a umlimited number of bookmarks, because each
time
the program is run different numbers of selections can be made (although its
not normally
more than about 4/5).
What I have done so far is to insert the string and add a vbCr & vbCr so
that when the
next string is inserted it has a blank line between them.
This method is a kinda ugly way to do things. What I was thinking would be a
better way
would be to use a table, which the first bookmark is in anyway.
The basic logic of the code would be something like
i = 1 to rows.selected
n = 1
activedocument.table(2).row(n).column(2).insertstring
table.rows.insert
n = n + 1
next 1
The other advantage to doing it this way is that I want to be able to format
certain parts of
each string. A string might look like;
Name: John Smith
Adress: 123 Any Street
And I want to format Name in bold and John Smith in Italics. I suppose if
they are repeated
for every string I could add them and format them at the time I insert the
new row in the table?
Thoughts? Sample code?
Cheers
- Al
I have a form that consists of mainly text boxs and have been using
Bookmarks
(which happen to be inside tables) to get the data inserted into the
template in the right place.
However I have introduced a multi-selectable listbox. The user can select
one or
more entry in the list box. The problem with this is that I can insert the
first selection
at a bookmark, but cant have a umlimited number of bookmarks, because each
time
the program is run different numbers of selections can be made (although its
not normally
more than about 4/5).
What I have done so far is to insert the string and add a vbCr & vbCr so
that when the
next string is inserted it has a blank line between them.
This method is a kinda ugly way to do things. What I was thinking would be a
better way
would be to use a table, which the first bookmark is in anyway.
The basic logic of the code would be something like
i = 1 to rows.selected
n = 1
activedocument.table(2).row(n).column(2).insertstring
table.rows.insert
n = n + 1
next 1
The other advantage to doing it this way is that I want to be able to format
certain parts of
each string. A string might look like;
Name: John Smith
Adress: 123 Any Street
And I want to format Name in bold and John Smith in Italics. I suppose if
they are repeated
for every string I could add them and format them at the time I insert the
new row in the table?
Thoughts? Sample code?
Cheers
- Al