Problem #2: removing active references, and file read only

K

Keith R

I wrote a VBA tool to help me fill out some extensive paperwork. Now I want
to share that tool with some colleagues, but I have to make it error-free
first. Here's one problem I ran in to:

I created a template, from which I can create new documents, which
(automatically) include the reference to the template, so it gives them a
custom toolbar which loads userforms when different toolbar buttons are
pressed.

The problem is after the user has finished using the VBA tools to create
their document (filling in sections, etc) then they have to send it,
without macros, to another party. I had no idea how to do this in code, so
I started by trying to do it manually.

It wouldn't let me remove the reference to the project until I first
removed the toolbar, then I was able to remove the reference (I can figure
out how to get rid of the toolbar in code). I seem to remember that when I
tried to just copy the file to a disk to see if it would automatically
unreference, it gave some kind of error.

Then, after I removed the reference, and saved it to disk, it did open just
fine- but when I made changes and tried to save, the source file on the
disk was read-only (it didn't even give the option to over-write). Since my
users might do last-minute tweaking, I have to leave it as a regular file.
I checked the file attributes, and "archive" was checked, so I unchecked it
and re-opened the file, but it kept ending up "read only" no matter what I
tried.

So, I'm looking for advice on how to:
(after I programatically remove the toolbar)
use VBA to unreference the template from the file
use VBA to make sure the file (wherever it is) is not read-only


Any help is greatly appreciated-
Keith R

Using Word 97 on Win 95, yuck.
 
G

Geert

Maybe I missed the point, but I would suggest that you
place all the code and the toolbar in a template (called
mytool.dot) and place this in de startup (or wrdstart)
folder of you/users. The documents they create can then
be simple templates.
Doing so they allways have the toolbar and the macros
available and the documents they create don't.
greetz
Geert D.
 

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