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 / April 2006

Tip: Looking for answers? Try searching our database.

Insert a Linked File in a protected document

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
SCook - 12 Apr 2006 03:34 GMT
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
Jay Freedman - 12 Apr 2006 04:25 GMT
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

>Good evening,
>
[quoted text clipped - 3 lines]
>Thank you for your time,
>SCook

--
Regards,
Jay Freedman
Microsoft Word MVP        FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit.
SCook - 12 Apr 2006 14:51 GMT
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

> 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,
[quoted text clipped - 18 lines]
> Microsoft Word MVP        FAQ: http://word.mvps.org
> Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit.
Jay Freedman - 12 Apr 2006 19:17 GMT
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?

Signature

Regards,
Jay Freedman
Microsoft Word MVP          FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

> Jay,
>
[quoted text clipped - 31 lines]
>> Email cannot be acknowledged; please post all follow-ups to the
>> newsgroup so all may benefit.
SCook - 12 Apr 2006 22:16 GMT
Thank you Jay. This sounds more complicated than expected. I will have to
think about this for a while.

Thank you again,
SCook

> 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
[quoted text clipped - 65 lines]
> >> Email cannot be acknowledged; please post all follow-ups to the
> >> newsgroup so all may benefit.
 
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.