Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 06-14-2019, 04:12 PM
gmaxey gmaxey is offline Input Box Help/Storing Variables in other Macros Windows 10 Input Box Help/Storing Variables in other Macros Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,636
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

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
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
 



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
Input Box Help/Storing Variables in other Macros 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

Other Forums: Access Forums

All times are GMT -7. The time now is 03:49 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft