Storing arrays within a template

D

Dave Morgan

Hi,

Could someone please point me in the right direction on this?

What I’m trying to achieve is this:

Create a single template to contain some simple boilerplate and code that
will build a document based on user selection of one or more command buttons
(on a custom tool bar – which I can do).
These command buttons would then build the document based on ‘semi
permanent’ text stored within the template.
The complication is that I’d like to make this multilingual. That is, the
stored text strings would effectively become arrays with different language
representations of the same object.
When I say ‘semi permanent’ above, I’d like to give the user the capability
to edit or add to these arrays of text. An example might be colour, So the
array might be, Green, Grüne, Verde, Groen, etc. I might need 100 or so of
these.

So the question is, Can this be done? Should I try this with, Docvariable
(Not sure, they can have arrays though), Autotext, doc properties or
something else? And can you please point me in the right direction where I
might be able to find some example code for storage and retrieval of said
values.

I guess I could always use an external file and read the values in, however,
I think this is a bit sloppy and doesn’t allow for easy distribution of the
template.

If this is off the scale, or I missed a previous post where its already
explained, then sorry of the inconvenience.

Alternatively, if some VBA magician can give me a pointer, I’ll be amazed at
your brilliance and forever in your debt.

Kind Regards,

Dave
 
J

Jean-Guy Marcil

Dave Morgan was telling us:
Dave Morgan nous racontait que :
Hi,

Could someone please point me in the right direction on this?

What I'm trying to achieve is this:

Create a single template to contain some simple boilerplate and code
that will build a document based on user selection of one or more
command buttons (on a custom tool bar - which I can do).
These command buttons would then build the document based on 'semi
permanent' text stored within the template.
The complication is that I'd like to make this multilingual. That
is, the stored text strings would effectively become arrays with
different language representations of the same object.
When I say 'semi permanent' above, I'd like to give the user the
capability to edit or add to these arrays of text. An example might
be colour, So the array might be, Green, Grüne, Verde, Groen, etc.
I might need 100 or so of these.

So the question is, Can this be done? Should I try this with,
Docvariable (Not sure, they can have arrays though), Autotext, doc
properties or something else? And can you please point me in the
right direction where I might be able to find some example code for
storage and retrieval of said values.

I guess I could always use an external file and read the values in,
however, I think this is a bit sloppy and doesn't allow for easy
distribution of the template.

If this is off the scale, or I missed a previous post where its
already explained, then sorry of the inconvenience.

Alternatively, if some VBA magician can give me a pointer, I'll be
amazed at your brilliance and forever in your debt.

I would use DOCVARIABLES.

As long as you are consistent with the order and use a unique delimitation
character, like the pipe character, you can easily use the Split function to
get the correct word you need.

Just a create a function that will retrieve al the words you need according
the language selected, i.e. all the first, second, third, etc. terms from
each DOCVARIABLE.

You can also create a function that will update all the DOCVARIABLES from a
Word Table or an Excel mini-database.
 
D

Dave Morgan

Thank you.

I'll investigate the DOCVARIABLE option and see what it can offer.

Kind Regards

Dave
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top