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.