Create Command button to attach another file as an icon to Word form

N

n_nally

I have a Word form and I need to allow either a spot where a file can
be dragged and dropped into the form as an embedded object and
displayed as icon.

Or

I need to create a command button to attach the file to the form. I
want it displayed as an icon (not actually display the file). The
file that will need attached will be a .msg file.

I am VERY new to VBA so the exact code would be VERY VERY appreciated.

Many thank!
 
G

Graham Mayor

Is this a specific file, a file selected on the basis of the form content or
some random file?
Which Word version?

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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
N

n_nally

Sorry, I need to be able to browse to the file wherever it is stored.
I am using Office 2003.

So basically, the user would click a "Browse" command button which
would launch the open dialogue box, then they would choose the file
and that would embed the file into the Word Document as an icon.

If possible, it would be easier just to allow the user to drag and
drop a file into the document as you normally can in an unprotected
document. But since this is a protected form, I am unable to find a
way to allow this to happen.
 
G

Graham Mayor

In that case insert an unprotected section in the document and use the
insert > object command to insert the file.

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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
N

n_nally

How do you insert an unprotected section when you are protecting the
document with the "Fill in Forms" Setting?
 
J

Jay Freedman

Insert a section break between the area containing the form fields and the
area that should be unprotected.

Display the Protect Document task pane (in Word 2003, click Tools > Protect
Document; in Word 2007, click the Protect Document button on the Review tab
of the ribbon and choose Restrict Formatting and Editing).

Check the box for "Allow only this type of editing", and set the dropdown to
"Filling in forms".

A blue link "Select sections" will appear below the dropdown (it appears
only when the document has two or more sections). Click it to open a small
dialog, where you can uncheck the section(s) that you want to leave
unprotected.

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

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