Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Word VBA Discuss using VBA to program Word.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Word VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old January 11th, 2007, 03:45 PM
Registered User
 
Join Date: Jan 2007
Location: Atascadero, CA, USA.
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Default File Name

I would like to use a macro in a template to set the filename of the document created by the template with out actually saving the file. I do not know the location where the user will save the file so I want to ceate a default file name only not the full path so that when the user does save the document the default file name is provided but the user can set the location for saving the file.

  #2 (permalink)  
Old October 31st, 2008, 04:02 PM
Registered User
 
Join Date: Oct 2008
Location: Sheffield, South Yorkshire, United Kingdom.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Dim dlgSaveAs As FileDialog

Set dlgSaveAs = Application.FileDialogFileDialogType:=msoFileDialo gSaveAs)

dlgSaveAs.InitialFileName = strFileName 'Variable holding your new filename
dlgSaveAs.Show

ActiveDocument.Close



Similar Threads
Thread Thread Starter Forum Replies Last Post
UserForm to Save File with default name FriendlyGrizzly Excel VBA 1 June 17th, 2008 10:49 PM
default ambrosejp SharePoint Admin 2 April 20th, 2006 01:56 PM
Access to print PDF file to default printer Dkline Access VBA 0 July 7th, 2004 03:24 PM
Default file locations selbybrock Excel VBA 0 March 9th, 2004 12:50 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.