Insert document based on dropdown selection

  • Thread starter Thread starter caksey
  • Start date Start date
C

caksey

Hi all,

Is it possible to insert a document from file into the active documen
based on a dropdown selection? I have five dropdown selections on
'main' sheet which users can pick which other documents to attach t
it. Currently this means finding the documents, opening them and the
printing them off for adding to the 'main' sheet. It would be ideal i
the other documents could be automatically added based upon th
dropdowns.

Any help will be appreciated
Trefo
 
Formfields have bookmarknames attached. Thus you could use the content of
the bookmark in conjunction with a conditional field to insert a document
(or autotext). eg.

{IF {REF Dropdown1} = "Condition" "{INCLUDETEXT "c:\\path\\docname.doc"}"}

You could add five of these on the same line without spaces between them to
provide the five documents. Obviously you need to put the field where the
document is to be inserted and you need to check the calculate on exit box
in the form field properties. "Condition" is the content of the selection.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>
Graham Mayor - Word MVP

Web site www.gmayor.com
Word MVP web site www.mvps.org/word
<>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>
 
Dim myrange As Range
ActiveDocument.Unprotect
Set myrange = ActiveDocument.Range
myrange.Collapse wdCollapseEnd
myrange.InsertFile "Drive\Path\" &
ActiveDocument.FormFields("DropDown1").DropDown.Value & ".doc"
ActiveDocument.Protect wdAllowOnlyFormFields, NoReset


--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
Back
Top