Insert a Linked File in a protected document

S

SCook

Good evening,

I would like to insert a linked file into a protected template without
unprotecting it. Is there a way to do this?

Thank you for your time,
SCook
 
J

Jay Freedman

No, you *must* unprotect the document to insert anything (other than
inside a form field). When this is done under the control of a macro,
it doesn't give the user any chance to change things, so it's safe.

ActiveDocument.Unprotect
' do some work, such as inserting
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, _
NoReset:=True
 
S

SCook

Jay,

What I would like to do then is to make a button in a certain part of the
template that would allow the user to insert a linked file. After the linked
file is inserted, it would need to be able to be double clicked on (from the
template) to open it in a different window. Is the macro below something that
I can copy/paste into a button to make this work? If not, can you please let
me know what I would need to do?

Thanks again,
SCook
 
J

Jay Freedman

No, the code I showed you is incomplete, just a small piece that would allow
an experienced programmer to see what to add to an existing macro so it
would work in a protected form. The complete macro to insert the linked file
would be considerably more complex, and I'm not sure the part about clicking
to open it in a separate window is even possible.

The job as a whole is complicated enough that I wouldn't offer to do it
gratis, and it doesn't sound like you have the expertise to do it yourself.
You may want to hire a consultant to design the template for you.

Here are some questions that you would need to answer before a macro could
even be planned:

- What kind of file is being inserted? Text only, a single picture, an
entire Word document, an Excel spreadsheet, or something else?

- How big will the inserted file be? One line? More than one line but less
than one page? More than one page?

- How do you expect the user to choose which file to link in? Do you need
something like the File > Open dialog? Does the selection of files need to
be restricted in any way?

- Does the "button" need to be in a specific place in the document, or can
it be on a toolbar, with the insertion location marked by a bookmark?

- Is it OK if the button remains in the document (and is printable), or
should it be removed as the file is inserted?

- Will there be a need for more than one insertion per document?

- Will there be a need to remove an insertion, or to replace an insertion
with a different linked file?

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
S

SCook

Thank you Jay. This sounds more complicated than expected. I will have to
think about this for a while.

Thank you again,
SCook
 

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