Insert object/file into Word form

7,123

Solution 1

Try making a new section/section break where you want the inserted file to go, and unprotect that single section.

Solution 2

I've used the following VBA script within a button click action, to simulate the "Insert Object" functionality within the document:

This code can go inside the button "click" event as-is.

' Browse & Select File
With Application.FileDialog(msoFileDialogFilePicker)
        .AllowMultiSelect = False
        .Title = "Select the File that you want to insert"
        If .Show = True Then
            FiletoInsert = .SelectedItems(1)
        Else
            Exit Sub
        End If
    End With

' Embed File Inline
    Application.Selection.InlineShapes.AddOLEObject _
        FileName:=FiletoInsert, _
        LinkToFile:=False, _
        DisplayAsIcon:=True, _
        IconLabel:=Right(FiletoInsert, Len(FiletoInsert) - InStrRev(FiletoInsert, "\"))
Share:
7,123

Related videos on Youtube

FrustratedWithFormsDesigner
Author by

FrustratedWithFormsDesigner

Updated on September 17, 2022

Comments

  • FrustratedWithFormsDesigner
    FrustratedWithFormsDesigner almost 2 years

    I am setting up a form in MS Word. Users of the form will have to attach files that include results and other relevant data.

    I'd like to use a protected form, but I can't find a way to allow users to insert these objects into the form. Is it even possible?

    I've also thought about having them copy/paste paths to files on a shared drive, but sometimes the directories change or move so I'd really rather have embedded documents.

    What alternatives are there, if what I want is not possible?

    (using Office 2003)

  • FrustratedWithFormsDesigner
    FrustratedWithFormsDesigner over 13 years
    It's possible to un-protect parts of a form/document?
  • Duall
    Duall over 13 years
    Indeed it is! Make sure you use section breaks befor and after the unprotected part, and it should give you a dropdown of selected sections in the "Protect Document" pane. Just leave the area you want them to insert in unprotected.
  • Duall
    Duall over 13 years
    Article on section breaks: office.microsoft.com/en-us/word-help/… Arcticle on unprotecting a section: infopackets.com/news/carols_corner_office/2007/… If you wanted a little more info. =)