UserForms - Templates and Documents

E

Eric

The application starts as a Word template (.dot) file that contains VBA code
and a userform. When a doc file is created from the dot file on the
development machine, everything works well.

If the doc file is zipped and emailed to another user, the userform and the
line of code that shows the form is stripped. The VBA editor does show a
reference to source dot file, but that's all.

Without forcing several hundred users to install add-ins or global
templates, is there a way to add the userform to the resulting doc file?

Incidentally, a simple message box would have sufficed, except for a single
problem. The MsgBox function only allows 1024 characters in the prompt
string, and about 1200 are needed.
 
C

Charles Kenyon

Could you use the Title string to supplement your prompt?

Othewise, you could, with vba, move the form and a supporting module to
documents as a part of a document_new event. Not sure this would be all that
useful, though, given that it would be blocked in the document by macro
security in many instances.
 
D

David Sisson

If the doc file is zipped and emailed to another user, the userform and
the line of code that shows the form is stripped

Worked as designed.
Without forcing several hundred users to install add-ins or global
templates, is there a way to add the userform to the resulting doc file?

Save the dot file as a doc file and distribute. I would password
protect your code. But as Charles already stated, your end users will
probably have macro security issues.
problem. The MsgBox function only allows 1024 characters in the prompt
string, and about 1200 are needed.

The title property also has a 1024 limit, plus it gets trunicated after
76 characters.

Create a userform with a label. Make the label as big as you need to
hold your text.

Another option would be to build a Windows help file and link it to the
msgbox.
 
C

Charles Kenyon

I was thinking that the Title could hold the some characters, even if
possibly not enough.

--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 

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