Do you get error messages? Nothing happens?
The popup you are describing is what is called a UserForm. You would need
the form itself in your document as well as the code modules. You can see
this in the vba Explorer. Alt-F11
Your toolbar button may be looking for code in your template, not in the
document, even if the code is in the document. You may need to recreate the
toolbar button in the document.
--
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://word.mvps.org/FAQs/ 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.
--
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://word.mvps.org/FAQs/ 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.
Post by Debra AnnSorry for not being more detailed. I have a toolbar button that calls a
macro. The macro shows the popup (ReferendeTable.Show). The code below is
the initialize part of the popup form. I also have code on an Insert command
button that, once they select the reference in the table dropdown list, will
insert the reference in the document.
I would love to distribute as a template. Unfortunately, they are using a
records management software called Documentum. In this software, the user
chooses which report they want, it assigns the number for the report, checks
it out of Documentum and puts it in a "Documentum Checkout" folder on their
harddrive for them to use. The version of Documentum we have has a bug in it
and cannot do templates. Therefore only Word Documents can be distributed
until they get the new version which won't be for another 3-4 months.
I can send you the Word Document and the Template Document version. You
will see the the Template Document works fine and the Word Document does not
(with the same code).
Thanks for any help you can offer.
--
Debra Ann
Post by Charles KenyonYour code doesn't do anything until its userform is started. Do you have
separate code to display the userform? If it is in an AutoNew macro in your
template, it would need to be in an AutoOpen macro in your documents.
Putting code in documents is seldom necessary and never a good idea. Why is
it that you can't distribute the template?
--
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://word.mvps.org/FAQs/ 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.
Post by Debra AnnThanks for the info. Your website page helped me to understand that Word
Documents can also contain toolbars and macros. So I went to the organizer
and copied my toolbars and my macros to an actual Word Document and I
see
the
toolbar and the macros. There is just one problem and I'm not sure how to
I have the following code which updates a dropdown list with the
cross-reference list for tables. It initializes every time from template
document (.dot), but it does not always initalize in the Word Document (.doc)
containing the macros. I could see if it never did or also did, but
sometimes it works and sometimes it doesn't.
VERY CONFUSED!!!
Private Sub UserForm_Initialize()
Dim varXRefs As Variant
Dim Index As Integer
' Clear out any previous contents
Me.cboTableNumber.Clear
' Load just the endnotes into varXRefs
varXRefs = ActiveDocument.GetCrossReferenceItems _
(ReferenceType:="Table")
' Load the ListBox from varXRefs as an array
For Index = 1 To UBound(varXRefs)
Me.cboTableNumber.AddItem varXRefs(Index)
Next Index
' Test whether the list has any entries and
' set command buttons accordingly
If Me.cboTableNumber.ListCount > 0 Then
Me.cboTableNumber.ListIndex = 0
Me.cmdInsert.Enabled = True
Else
ReferenceTable.Hide
MsgBox ("There are no tables to cross-reference.")
End If
End Sub
--
Debra Ann
Post by Charles KenyonYour macros and toolbars are in the template. It is on your hard
drive.
It
makes sense that people using different computers can't use the parts that
are on your computer. You may want to distribute your template as a document
template or as a global template, depending on whether the toolbars and
macros are useful only in documents created from your template or are useful
in other documents as well. See
http://addbalance.com/word/movetotemplate.htm for step-by-step instructions
on moving / sharing / copying / backing-up customizations including
AutoText, AutoCorrect, keyboard assignments, toolbars, macros, etc. Also
take a look at
http://word.mvps.org/FAQs/MacrosVBA/DistributeMacros.htm.
--
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://word.mvps.org/FAQs/ 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.
Post by Debra AnnI created a template with toolbars and macros. I then opened a new document
from the template and saved it as a Word Document. I don't understand
how
it
stays attached to other people that look at it. When I open the file,
I
see
the toolbar and can use the macros. When other people take it from the
network, the toolbar is gone and they can't see the macros.
Is it because the template is on my harddrive? Do I have to save it some
other way?
Thanks in advance.
--
Debra Ann