[RESOLVED] Removing File Name From SaveAs Dialog
NeedSomeAnswers posted some code in my last question that allows me to intercept the Save feature of a Word document, and thus, force the user to use SaveAs instead. This is a good thing as I'm using a couple of templates that I made in Word, and do not want the original template overlaid.
However, when they click SaveAs, and the SaveAs dialogbox comes up, the original document name is displayed. How can I wipe that out, and present a SaveAs dialog with nothing in the file name textbox?
Re: Removing File Name From SaveAs Dialog
Hack
Put this in ThisDocument
VB Code:
Sub FileSaveAs()
Dim strFileAs As String
With Application.FileDialog(msoFileDialogSaveAs)
.InitialFileName = ""
.Show
strFileAs = .SelectedItems.Item(1)
End With
ActiveDocument.SaveAs strFileAs
End Sub
Re: Removing File Name From SaveAs Dialog
Re: [RESOLVED] Removing File Name From SaveAs Dialog
Works like a champ. Thank you Danny.
This makes two routines I've copied and pasted into my word document, and I added an error trap all by myself. (Damn I'm good :p )
RobDog888: You better watch out buddy, there is a new VBA guru in town! :D
Re: [RESOLVED] Removing File Name From SaveAs Dialog
Yes, DMK is quite good but I still rule Office VBA ;) I'm a Leo, remember? King of the Office VBA jungle. :lol:
Soon as I get back from building my block wall there will be a new RobDog888 to watch out for. ;)
Re: [RESOLVED] Removing File Name From SaveAs Dialog
Actually, in a tongue-in-cheek fashion, I was referring to me as the new VBA guru 'cause I copied and pasted two routines I didn't write into a document. :rolleyes:
Re: [RESOLVED] Removing File Name From SaveAs Dialog
We shall see.. we shall see... :D
Ain't started yet.. :D
Is that a wall for protection? :lol:
5 gems.. at my rate I'll be six in two more months..:D If only they weren't gray..
Re: [RESOLVED] Removing File Name From SaveAs Dialog
He he, either way its great to see the VBA forum packing some decent traffic after all my longs moinths of building it up from < 30 threads a month to 200+ threads a month. Thanks to all who help post in VBA. :thumb:
Re: [RESOLVED] Removing File Name From SaveAs Dialog
Yep..
People under estimate VBA.. some of the stuff I can do with it (Until MSDN Sub my company wouldn't let use anything other than office) will blow your mind..:D
I'll be around to help as many as I can for some time