Mar 20 2023 10:58 AM
Mar 20 2023 10:58 AM
I have a user that is having some issues when hyperlinking word documents. Is there a way to change the default file type index/search? (See screenshot below).
The reason this is an issue is that the user have to change to "All Files" every time and didn't always have to do that, it used to be the default. This user does this hundreds of times a day so i was hoping to save them some clicks by changing the default to "All files". I have a different user that have that as the default so i know it should work i just cannot seem to find the setting or the name of that file type box marked below.
Any help is appreciated!
Mar 20 2023 03:12 PM
@RasmusP Using a macro with the following code will display a file picker dialog with the file type set to All Files (*.*) and then when a file is selected, a hyperlink to that file will be inserted with the text that was selected when the macro was run as the display text.
Dim FD As FileDialog
Dim strAddress As String
Set FD = Application.FileDialog(msoFileDialogFilePicker)
.Title = "Select the to which you want the link to address."
' .InitialFileName = " insert path to desired folder"
.Filters.Add "All Files", "*.*"
.AllowMultiSelect = False
If .Show = -1 Then
strAddress = .SelectedItems(1)
MsgBox "You did not select a file."
ActiveDocument.Hyperlinks.Add Selection.Range, strAddress, , , Selection.Text
Mar 24 2023 07:58 AM - edited Mar 24 2023 09:06 AM
I've been trying to get this macro to work but i can't seem to get it to work. I don't have much experience with macros so i tried following guides but for some reason it's still not working. Any suggestions?
Otherwise the ideal solution would be to just change the setting instead of creating a click elsewhere like this macro would do.
Mar 24 2023 01:03 PM
@RasmusP Did you put the code inside a Sub macroname() End Sub construction such as
[put code here]
It you assign the macro to a button on the quick access toolbar, I believe that your user will find it to be an easier way to insert a hyperlink.