Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / January 2005

Tip: Looking for answers? Try searching our database.

Letting others use routines I've written

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Christopher Brewster - 11 Jan 2005 18:42 GMT
My VBA programming has always been only for myself, up to now. But I've created a document conversion program that is needed by others, and I cannot get it to work on their computers. I copied the template to a network drive, then copied from there to Word's Templates directory on a co-worker's computer. Then I attached it to the document that he wanted to convert, but when I bring up the Macros dialog, the list of macros is blank, even when I specify the template name in the "Macros in" box.

So there's something I'm missing about the VB environment. Also, it would be nice if, on other machines, users did not have to first attach the template to the document before using it. Any help appreciated.

Christopher Brewster
Lockheed Martin
Malcolm Smith - 11 Jan 2005 19:22 GMT
Christopher

If you put the .dot file into the start-up folder of the machines then
they will see the code when they start Word.

- Malc

> *From:* "Christopher Brewster via OfficeKB.com" <forum@OfficeKB.com>
> *Date:* Tue, 11 Jan 2005 18:42:40 GMT
[quoted text clipped - 14 lines]
> Christopher Brewster
> Lockheed Martin
Jean-Guy Marcil - 11 Jan 2005 19:26 GMT
Christopher Brewster via OfficeKB.com was telling us:
Christopher Brewster via OfficeKB.com nous racontait que :

> My VBA programming has always been only for myself, up to now. But
> I've created a document conversion program that is needed by others,
[quoted text clipped - 9 lines]
> attach the template to the document before using it. Any help
> appreciated.

Have you tried placing the template in the user's Word Start-up folder?
Then it will become a global template with its macros/toolbars/autotexts
available to all opened documents (without attaching it).

See what this folder is from Tools > Options... > File Locations tab.

Signature

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org

Christopher Brewster - 11 Jan 2005 21:22 GMT
[2nd attempt to post. Sorry if duplicated.]

Thanks for the responses. I did as you suggested, putting the template in the Startup folder, but it still doesn't work. The problem may be in how I created the template. I developed the code in my Normal template. When it was ready, I copied the modules I needed into a new template. This is the template that is on the network drive. Is there a better way to create this?

Christopher Brewster
Charles Kenyon - 11 Jan 2005 22:33 GMT
You'll seldom want to copy entire modules from normal.dot, especially the
New Macros module which is where recorded macros are stored. Use the vba
editor to copy individual macros. Although I'll sometimes start with a macro
recorded or written in normal.dot, I will usually record or write it
directly in the template I'll be using. It just seems easier to do it that
way, to me.

To be more help, people here will need to actually see your code, know what
it is you are trying to do, how it works when it is on your system, and how
it doesn't work when in an Add-In.

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.
Signature


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.

> [2nd attempt to post. Sorry if duplicated.]
>
[quoted text clipped - 6 lines]
>
> Christopher Brewster
Alex Ivanov - 12 Jan 2005 02:15 GMT
... and make sure your users have macro security set to something other than
"High"

Signature

Please reply to NG only. This email is not monitored.
Alex.

> You'll seldom want to copy entire modules from normal.dot, especially the
> New Macros module which is where recorded macros are stored. Use the vba
[quoted text clipped - 21 lines]
>>
>> Christopher Brewster
Charles Kenyon - 12 Jan 2005 13:55 GMT
Or that your macros are in trusted locations / templates.
Signature


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.

> ... and make sure your users have macro security set to something other
> than "High"
[quoted text clipped - 24 lines]
>>>
>>> Christopher Brewster
Jonathan West - 11 Jan 2005 22:16 GMT
> My VBA programming has always been only for myself, up to now. But I've
> created a document conversion program that is needed by others, and I
[quoted text clipped - 7 lines]
> be nice if, on other machines, users did not have to first attach the
> template to the document before using it. Any help appreciated.

Hi Christopher

This article may help you

Distributing macros to other users
http://word.mvps.org/FAQs/MacrosVBA/DistributeMacros.htm

Signature

Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup

Christopher Brewster - 12 Jan 2005 21:08 GMT
My previous post was premature. Now I remember how I got in the fix: when I do all that I described, the resulting project is unviewable. I was trying to make a template separate from normal.dot that would allow me to develop in it. I can't think of any way to make it "cleaner" than the way I've done it. Any more suggestions? Thanks.

Christopher Brewster
Lockheed Martin
Jonathan West - 12 Jan 2005 21:25 GMT
> My previous post was premature. Now I remember how I got in the fix: when
> I do all that I described, the resulting project is unviewable. I was
> trying to make a template separate from normal.dot that would allow me to
> develop in it. I can't think of any way to make it "cleaner" than the way
> I've done it. Any more suggestions? Thanks.

Create a new blank template. With the template open, press Alt-F11 to open
the VBA editor. In the project pane in the top left, you can click and drag
modules from one template to another. Then save the new template with the
module. Check that everything is there before deleting the modules from
normal.dot.

Signature

Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup

Christopher Brewster - 12 Jan 2005 21:25 GMT
To answer my own question: I needed to do these things:

- copy the modules from Normal.dot into my new template
- delete the same modules from Normal.dot
- leave the new template in my Templates directory
- put the new template in the other user's Word Startup directory

Now I can develop within the new template, and the other guy can use the macros without attaching to each doc. It's all so clear now!

Christopher Brewster
Lockhee Martin
Charles Kenyon - 12 Jan 2005 22:15 GMT
You can develop in a template that is loaded as an Add-In (in the Startup
folder); you simply have to open the template (like you would open a
document). This gives you access to the vba project.
Signature


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.

> To answer my own question: I needed to do these things:
>
[quoted text clipped - 8 lines]
> Christopher Brewster
> Lockhee Martin
Christopher Brewster - 25 Jan 2005 20:58 GMT
Oh, I see the answer in the same thread after my summary note, from Charles Kenyon. Thanks, Charles.
Christopher Brewster - 25 Jan 2005 20:52 GMT
I started this thread with a question, got good answers, finished my program, thought I understood the issue, came back to it a week later, and I'm getting "Project is Unviewable". The template is its own project, no duplication with other templates, etc. Maybe I'm dense, but this issue seems unnecessarily difficult. Any suggestions?

To summarize the thread, excerpt of my original:

  My VBA programming has always been only for myself, up to now. But I've created a document conversion program that is needed by others, and I cannot get it to work on their computers.

My conclusions after your suggestions:

  To answer my own question: I needed to do these things:

  - copy the modules from Normal.dot into my new template
  - delete the same modules from Normal.dot
  - leave the new template in my Templates directory
  - put the new template in the other user's Word Startup directory

  Now I can develop within the new template, and the other guy can use the macros without attaching to each doc. It's all so clear now!
Tom Winter - 25 Jan 2005 23:07 GMT
"Project is Unviewable" usally means you are trying to view the code in a
loaded add-in. You'll need to actually OPEN the .DOT file (FILE | OPEN) and
then you should be able to view the code.

Signature

Tom Winter
Tom@NoSpam.AmosFiveSix.com

> I started this thread with a question, got good answers, finished my program, thought I understood the issue, came back to it a week later, and
I'm getting "Project is Unviewable". The template is its own project, no
duplication with other templates, etc. Maybe I'm dense, but this issue seems
unnecessarily difficult. Any suggestions?

> To summarize the thread, excerpt of my original:
>
>    My VBA programming has always been only for myself, up to now. But I've created a document conversion program that is needed by others, and I cannot
get it to work on their computers.

> My conclusions after your suggestions:
>
[quoted text clipped - 6 lines]
>
>    Now I can develop within the new template, and the other guy can use the macros without attaching to each doc. It's all so clear now!
Alex Ivanov - 26 Jan 2005 01:47 GMT
If all you need is to modify the code, it's better to create a new document
based on the template - double-click the .dot file.
Thus you won't accidentally corrupt the contents of the template while
debugging the code. You can save the vb project from the code window, but
changes made to visual appearance of the resulting new document won't be
saved in the template.

HTH

Signature

Please reply to NG only. This email is not monitored.
Alex.

> "Project is Unviewable" usally means you are trying to view the code in a
> loaded add-in. You'll need to actually OPEN the .DOT file (FILE | OPEN)
[quoted text clipped - 27 lines]
>>    Now I can develop within the new template, and the other guy can use
> the macros without attaching to each doc. It's all so clear now!

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.