Template help

B

Bo Rasmussen

Hi,

I need a way to show help to users of my templates. This help could e.g.
show available macros and related shortcuts as well as instructions for
other things.

My idea was to create an autotext entry "HelpText" in each of my templates.
In a global template I would then create a macro "ShowHelp" which creates a
new document and inserts the relevant "HelpText" autotext.

The problem is that when I open a new document (based on the normal
template) the autotext is unavailable. So I tried to retrieve the autotext
prior to creating the document - but this gives me a String representation
which limits my autotext. For example I cannot use a table anymore - as the
table disappears.

Does anybody know how to do what I want?

Regards
Bo
 
P

Peter Hewett

Hi Bo Rasmussen

There's a couple of ways to do what you want.

You can either create a document as you do now or you could display a UserForm. The
problem with Office UserForms is that they cannot display combinations of normal, bold,
italic and underlined and mixed fonts, font sizes. So if you can live with this limitation
then a UserForm using multiline TextBox control can do what you want. There is an RTF
control that has more display features, I believe that's distributed as part of the VB6
runtime, but that means you have to distribute the controls and install the appropriate
dll's on all of the PC's that will use your template(s).

The other option is to create another document as you propose.

For either option you can embed the code in each Template or put the code in an Add-In.
Personally I'd use an Add-In as you only need to maintain the code in one place.

If you want to go with a UserForm I'd not use AutoText as there's an inherent limitation
of AutoText only return the first 255 characters when you query an entry using VBA. I'd
store the entry in a Document Variable and load the TextBox control from this. I'd code
the UserForm so that when you open the Template for editing the UserForm allows you to
edit the TextBox control and update the Document Variable. Conversely when you just
create/open a document based on the Template just disable editing on the TextBox and hide
the Cancel button.

Let us know if you require help or clarification with any of the above.

HTH + Cheers - Peter
 

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