Opening text files in Word

MARK858

MrExcel MVP
Joined
Nov 12, 2010
Messages
16,814
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
I would be delighted if anyone could help with by question below;

Due to security restrictions in place at work where some people have had there access to the C drive restricted, I have been using the code below to get the windows open file dialogue box in excel so that they can choose themselves where to put the file.
My question is therefore, is there an equivalent code in word Vba I can use to get the same functionality?

EXCEL CODE

Code:
Sub Filterun_Click()
Dim wsName As String
Call Filterun
End Sub
 
Sub Filterun(Optional strTitle As String)
    Dim i As Integer
    If Len(strTitle) = 0 Then strTitle = "..."
    DI = Application.GetOpenFilename("Text Files (*.txt), *.txt,All Files (*.*),*.*", , strTitle, , False)
    Workbooks.OpenText Filename:=DI
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

Forum statistics

Threads
1,224,582
Messages
6,179,670
Members
452,936
Latest member
anamikabhargaw

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