![]() |
|
#2
|
|||
|
|||
|
Your current receive does not open a Word document. Not here at least.
Try Code:
Option Explicit
Private Declare Function ShellExecute Lib "shell32.dll" _
Alias "ShellExecuteA" (ByVal hwnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long
Sub Commandbutton()
Receive InputBox("Enter the file path", "Open Document")
lbl_Exit:
Exit Sub
End Sub
Public Function Receive(ByVal WhichFilePath As String, _
Optional sParams As String = "", _
Optional sStartIn As String = vbNullString, _
Optional lngOpenMode As Long = 1) As Long
Receive = ShellExecute(0, vbNullString, WhichFilePath, sParams, sStartIn, lngOpenMode)
lbl_Exit:
Exit Function
End Function
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Macro keyboard commands and storing them | swepo | Word | 7 | 12-15-2018 11:44 AM |
| Array to iterate through variables and trap blank variables | Marrick13 | Word VBA | 5 | 08-04-2015 06:19 AM |
Code for storing new word
|
fahmiakbar | Word VBA | 2 | 02-13-2015 11:26 AM |
| can word: make variables, find appropriate pages, fill out pages with variables, print only those | 20GT | Word VBA | 1 | 10-15-2014 09:48 PM |
| Creating Wizards with Input Variables | marka | Excel Programming | 1 | 11-11-2012 09:43 AM |