Reply
 
Thread Tools Display Modes
  #1   Report Post  
Barb Reinhardt
 
Posts: n/a
Default VBA for Filename Creation without document Save

I have used a macro which creates a filename and saves the document to this
document name. The statement in the macro is currently:

ActiveDocument.SaveAs FileName:="blahblahblah" & Format(Order, "00#")

I like the way the document is named, but I don't want it saved at this
time. How do I update this statement so that the file is named and opened
only?

Thanks in advance,
Barb Reinhardt


  #2   Report Post  
Jay Freedman
 
Posts: n/a
Default

Barb Reinhardt wrote:
I have used a macro which creates a filename and saves the document
to this document name. The statement in the macro is currently:

ActiveDocument.SaveAs FileName:="blahblahblah" & Format(Order, "00#")

I like the way the document is named, but I don't want it saved at
this time. How do I update this statement so that the file is named
and opened only?

Thanks in advance,
Barb Reinhardt


Hi Barb,

You really can't, because the only time Word actually assigns a file name to
a document is during the save process. No save = no name.

But you can set things up so that your chosen name is suggested in the Save
dialog the first time the document is saved. See
http://word.mvps.org/FAQs/MacrosVBA/SetDefFilename.htm. If you know the name
you want at the time you create the document, put the code from the article
into a macro named AutoNew in the template so it runs right away.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org


  #3   Report Post  
Barb Reinhardt
 
Posts: n/a
Default

That does exactly what I want it to do. Thanks.
"Jay Freedman" wrote in message
...
Barb Reinhardt wrote:
I have used a macro which creates a filename and saves the document
to this document name. The statement in the macro is currently:

ActiveDocument.SaveAs FileName:="blahblahblah" & Format(Order, "00#")

I like the way the document is named, but I don't want it saved at
this time. How do I update this statement so that the file is named
and opened only?

Thanks in advance,
Barb Reinhardt


Hi Barb,

You really can't, because the only time Word actually assigns a file name

to
a document is during the save process. No save = no name.

But you can set things up so that your chosen name is suggested in the

Save
dialog the first time the document is saved. See
http://word.mvps.org/FAQs/MacrosVBA/SetDefFilename.htm. If you know the

name
you want at the time you create the document, put the code from the

article
into a macro named AutoNew in the template so it runs right away.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org




Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't save my word document!!! PL PL Microsoft Word Help 5 December 14th 04 08:59 AM
"Do you also want to save changes to the document template?" messa JoanN Microsoft Word Help 2 December 9th 04 07:17 PM
How do I save a document to a disk? Puffles Microsoft Word Help 3 December 9th 04 11:09 AM
I create & save a document then I can only open it in safe mode Don Microsoft Word Help 1 December 9th 04 07:15 AM
Save a Word Document as PDF??? Brandon Taylor Microsoft Word Help 1 December 3rd 04 03:13 PM


All times are GMT +1. The time now is 02:02 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"