#1
|
|||
|
|||
VBA save a NEW unsave document without prompting user for a file name
Using VBA how can I save a new document to a directory without promting the user for a flie name. The document has not been saved before. I am trying to save a newly created merged document. |
#2
|
||||
|
||||
See 'Send Mailmerge Output to Individual Files' and 'Split Merged Output to Separate Documents' in: https://www.msofficeforums.com/mail-...ps-tricks.html. The code for 'Send Mailmerge Output to Individual Files' saves the file to the same folder as the mailmerge main document and the code for 'Split Merged Output to Separate Documents' saves the file to the same folder as the source document, respectively, but you could specify a different folder.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
||||
|
||||
If you are not going to ask the user for the name, where do you propose getting the name from?
In addition to Paul's link, if this is a mailmerge then you can name the individual documents from the merge data, using one of three merge tools available from my web site e.g. http://www.gmayor.com/individual_merge_letters.htm or alternatively http://www.gmayor.com/MergeAndSplit.htm makes it pretty simple to merge just one record named from the file, but someone has got to provide a name before you can save.
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#4
|
|||
|
|||
I will provide the directory and name for the file. I cannot believe that this has not been done before.
|
#5
|
||||
|
||||
Both Graham and I have provided you with links to code showing you the general principles. For anyone even moderately competent in VBA it's hardly rocket science. Have you at least examined the code?
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#6
|
|||
|
|||
I examined the code and found what I was looking for, tested it, and it worked!!!
Sincerely, Grasshopper |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How can I save a Word Document as a PDF file with a merged field filename? | kp2009 | Word VBA | 5 | 08-27-2015 11:45 PM |
Force User to Save As | lgillespie | Word | 6 | 09-09-2013 03:13 PM |
Macro to create new word doc and save the file using String found in the document | VBNation | Word VBA | 2 | 02-08-2013 07:14 AM |
Outlook 2007 prompting to save attachments when they have been closed for hours | Bamlaw | Outlook | 0 | 09-06-2012 03:13 PM |
Print to PDF without prompting for file name | tpluta | PowerPoint | 0 | 10-07-2010 08:58 PM |