Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am using the following in a macro:
filename = ActiveDocument.GetApplication.
InputBox("Enter name of the file to be saved", "C:\document.txt")
Thanks, Nor
Hi,
If user hits Cancel button, InputBox function returns empty string "".
This example works for me:
fname=InputBox("Enter your name","Userinput")
if fname = "" then
fname=InputBox("Try it once more!","Userinput")
end if
Hope this helps
Tomas
Thanks for answering.
When I use the InputBox-function as you suggest, I have not found a way to already have an aswer pre-filled in in the inputbox. The other function has this possibility and I found this very usefull.
I've tested your solution and it is working, but not completely what I am looking for.
Nor
If you want a predefined text allready in inbox, use third parametr. Cancel button has same functionality (returns "").
Example:
fname=InputBox("Enter your name","Userinput","Predefined text here:)")