Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Incorporate Input Box User Response for Naming of File
Word 2003
I would like to use an Input Box within a procedure that asks the question: "What would you like to name this file?" I would additionally like to incorporate and concatenate the user's response to this question as the file name within the path for saving the document. I.e., C:\folder name\*User's Response*.doc. Thanks so much in advance for any assistance in this regard. Rod |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Incorporate Input Box User Response for Naming of File
On Sat, 12 Jan 2008 16:14:00 -0800, RPMitchal
wrote: Word 2003 I would like to use an Input Box within a procedure that asks the question: "What would you like to name this file?" I would additionally like to incorporate and concatenate the user's response to this question as the file name within the path for saving the document. I.e., C:\folder name\*User's Response*.doc. Thanks so much in advance for any assistance in this regard. Rod See http://www.word.mvps.org/FAQs/Macros...tainFolder.htm. -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. |
#3
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Incorporate Input Box User Response for Naming of File
Jay:
Thanks so very much. I haven't had a chance yet to put this macro into practice, but I am absolutely sure that not only will it be of tremendous assistance, but that it will be yet another step in my on-going commitment towards not only learning the ins and outs of VBA programming for Word, but additionally towards understanding and appreciating how it is that you guys know what you do. Thanks again - Rod "Jay Freedman" wrote: On Sat, 12 Jan 2008 16:14:00 -0800, RPMitchal wrote: Word 2003 I would like to use an Input Box within a procedure that asks the question: "What would you like to name this file?" I would additionally like to incorporate and concatenate the user's response to this question as the file name within the path for saving the document. I.e., C:\folder name\*User's Response*.doc. Thanks so much in advance for any assistance in this regard. Rod See http://www.word.mvps.org/FAQs/Macros...tainFolder.htm. -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. |
#4
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Incorporate Input Box User Response for Naming of File
Jay:
Although I copied and have been trying to use the code from the link you suggested, I find that somehow I am restricted from actually saving the document and as of yet have not been able to get past... *MsgBox "documents can't be saved in that folder. Please try again."* I have tried any number of naming combinations or conventions to get by whatever restriction exists within the code yet it continues to elude me. My guess would be that it has everything to do with... If LCase$(Left$(CurDir, 20)) "c:\my documents\test" Then MsgBox "Documents can't be saved in that folder. Please try again." Exit Sub End If ....and I'm not sure what steps I need to take in naming the file to get beyond the MsgBox, nor am I sure as to what the purpose of the restrictive coding might be. Thanks in advance - yet again - Rod "RPMitchal" wrote: Jay: Thanks so very much. I haven't had a chance yet to put this macro into practice, but I am absolutely sure that not only will it be of tremendous assistance, but that it will be yet another step in my on-going commitment towards not only learning the ins and outs of VBA programming for Word, but additionally towards understanding and appreciating how it is that you guys know what you do. Thanks again - Rod "Jay Freedman" wrote: On Sat, 12 Jan 2008 16:14:00 -0800, RPMitchal wrote: Word 2003 I would like to use an Input Box within a procedure that asks the question: "What would you like to name this file?" I would additionally like to incorporate and concatenate the user's response to this question as the file name within the path for saving the document. I.e., C:\folder name\*User's Response*.doc. Thanks so much in advance for any assistance in this regard. Rod See http://www.word.mvps.org/FAQs/Macros...tainFolder.htm. -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. |
#5
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Incorporate Input Box User Response for Naming of File
You're supposed to replace the path in double quotes with the (all lower case)
actual path that you want the document to be saved in; and you replace the 20 with the number of characters in that path. For example, if you wanted the document to be saved in the folder C:\Temp (which contains 7 characters), then you would change the line of code to If LCase$(Left$(CurDir, 7)) "c:\temp" Then The purpose of it is to make sure the user didn't change the path shown in the dialog to something other than the path to be enforced. On Mon, 14 Jan 2008 16:12:00 -0800, RPMitchal wrote: Jay: Although I copied and have been trying to use the code from the link you suggested, I find that somehow I am restricted from actually saving the document and as of yet have not been able to get past... *MsgBox "documents can't be saved in that folder. Please try again."* I have tried any number of naming combinations or conventions to get by whatever restriction exists within the code yet it continues to elude me. My guess would be that it has everything to do with... If LCase$(Left$(CurDir, 20)) "c:\my documents\test" Then MsgBox "Documents can't be saved in that folder. Please try again." Exit Sub End If ...and I'm not sure what steps I need to take in naming the file to get beyond the MsgBox, nor am I sure as to what the purpose of the restrictive coding might be. Thanks in advance - yet again - Rod "RPMitchal" wrote: Jay: Thanks so very much. I haven't had a chance yet to put this macro into practice, but I am absolutely sure that not only will it be of tremendous assistance, but that it will be yet another step in my on-going commitment towards not only learning the ins and outs of VBA programming for Word, but additionally towards understanding and appreciating how it is that you guys know what you do. Thanks again - Rod "Jay Freedman" wrote: On Sat, 12 Jan 2008 16:14:00 -0800, RPMitchal wrote: Word 2003 I would like to use an Input Box within a procedure that asks the question: "What would you like to name this file?" I would additionally like to incorporate and concatenate the user's response to this question as the file name within the path for saving the document. I.e., C:\folder name\*User's Response*.doc. Thanks so much in advance for any assistance in this regard. Rod See http://www.word.mvps.org/FAQs/Macros...tainFolder.htm. -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. |
#6
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Incorporate Input Box User Response for Naming of File
Jay:
As you might guess, the miscalculation was on my part, taking the supplied coding and your additional comments into account, I was able to modify the coding to do just what I needed. Thanks so very much for your assistance. I really do appreciate it. Rod "Jay Freedman" wrote: You're supposed to replace the path in double quotes with the (all lower case) actual path that you want the document to be saved in; and you replace the 20 with the number of characters in that path. For example, if you wanted the document to be saved in the folder C:\Temp (which contains 7 characters), then you would change the line of code to If LCase$(Left$(CurDir, 7)) "c:\temp" Then The purpose of it is to make sure the user didn't change the path shown in the dialog to something other than the path to be enforced. On Mon, 14 Jan 2008 16:12:00 -0800, RPMitchal wrote: Jay: Although I copied and have been trying to use the code from the link you suggested, I find that somehow I am restricted from actually saving the document and as of yet have not been able to get past... *MsgBox "documents can't be saved in that folder. Please try again."* I have tried any number of naming combinations or conventions to get by whatever restriction exists within the code yet it continues to elude me. My guess would be that it has everything to do with... If LCase$(Left$(CurDir, 20)) "c:\my documents\test" Then MsgBox "Documents can't be saved in that folder. Please try again." Exit Sub End If ...and I'm not sure what steps I need to take in naming the file to get beyond the MsgBox, nor am I sure as to what the purpose of the restrictive coding might be. Thanks in advance - yet again - Rod "RPMitchal" wrote: Jay: Thanks so very much. I haven't had a chance yet to put this macro into practice, but I am absolutely sure that not only will it be of tremendous assistance, but that it will be yet another step in my on-going commitment towards not only learning the ins and outs of VBA programming for Word, but additionally towards understanding and appreciating how it is that you guys know what you do. Thanks again - Rod "Jay Freedman" wrote: On Sat, 12 Jan 2008 16:14:00 -0800, RPMitchal wrote: Word 2003 I would like to use an Input Box within a procedure that asks the question: "What would you like to name this file?" I would additionally like to incorporate and concatenate the user's response to this question as the file name within the path for saving the document. I.e., C:\folder name\*User's Response*.doc. Thanks so much in advance for any assistance in this regard. Rod See http://www.word.mvps.org/FAQs/Macros...tainFolder.htm. -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How populate a document with user input? | Microsoft Word Help | |||
Pause Merge for User Input | Mailmerge | |||
file naming | Microsoft Word Help | |||
File naming specifications / Invalid file name | Microsoft Word Help | |||
input user value | Microsoft Word Help |