WORD VBA Code To Prompt Inserting A File Attachment

Justlikebrianw

Board Regular
Joined
Dec 9, 2015
Messages
52
Hello,

I know this is the excel forum, but I have a question that I believe would be related in MS Word. What is some code that I could use so that when the user clicks on an "Attach" button in MS word, it would bring up the prompt where they choose what file they want on their system and insert the file icon into word.

Is this possible?


Thanks so much
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Re: VBA Code To Prompt Inserting A File Attachment

I have the below code that works in excel but not in word?

Private Sub CommandButton1_Click()

Application.Dialogs(xlDialogInsertObject).Show

End Sub
 
Upvote 0
Re: VBA Code To Prompt Inserting A File Attachment

Code:
Application.Dialogs([COLOR=#0000ff][B]wd[/B][/COLOR]DialogInsertObject).Show
 
Upvote 0

Forum statistics

Threads
1,223,793
Messages
6,174,626
Members
452,575
Latest member
Fstick546

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top