Embed object and display as icon in word document?

1.5k views Asked by At

I have a word document. In the word document I have command button.

What I am after is when the user presses the command button it would open a dialog box so that the user can embed a file and display as an icon within the word document.

How WOULD I do this in VBA?

Ultimately I would like the following:

  1. User clicks on button
  2. Dialog box opens for user to choose file (any type)
  3. User clicks OK
  4. File is embedded(not linked) in document as Icon
  5. If user click cancel, dialog window closes.
1

There are 1 answers

1
0m3r On BEST ANSWER

Okay here is start

Option Explicit
Sub AddFileIcon()
    SendKeys "%F{TAB 4} {TAB 5}"
    Dialogs(wdDialogInsertObject).Show
End Sub

Now you Create Button :-) and call the Macro

Here is help full Links

VBA SendKeys


Word Dialog Boxes