![]() |
|
#1
|
|||
|
|||
|
I've got a form running perfectly with the exception of my "attach" button. I've got this macro attached to my button:
Code:
Private Sub CommandButton2_Click()
' 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, "\"))
End Sub
I've got my protection set up as shown in the attachment. How can I get the attach macro to play nice with the protection? Thank you! |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| VBA to create a button to attach the active word doc to an email as a PDF without using Outlook | TAKMalcolm | Word VBA | 1 | 09-21-2017 01:52 AM |
How do I attach a ribbon button to a particular template in Word 2010?
|
HelenT | Word VBA | 1 | 10-07-2015 03:32 AM |
| File Not Found error when trying to attach Word document to email | Kimber | Word | 0 | 03-06-2015 06:47 PM |
Command Button will not work when document is protected
|
brockjensen | Word | 1 | 11-02-2012 06:59 PM |
| Debug for macro run through button only when sheet protected | leahca | Excel Programming | 0 | 11-24-2011 04:47 AM |