View Full Version : Save As in word


vinimall
03-14-2008, 03:52 AM
Hi
I have a word document where on the On Close event I have the following code:

Sub SaveFilename()

Dim PathAndFileName As String, n As Long

PathAndFileName = Path & "\Letters\.doc"

If Dir(PathAndFileName & ".doc") = "" Then
ActiveDocument.SaveAs (PathAndFileName & ".doc")
Else
n = 1
Do While Dir(PathAndFileName & n & ".doc") <> ""
n = n + 1
Loop
ActiveDocument.SaveAs PathAndFileName & n & ".doc"
End If

End Sub

But it only works once and not everytime the document is closed. I would it like it work everytime the doc is closed is this possible?

I have a bookmark that inserts a piece of test when ithe doc is opened is there a way for me to use that text as the file name when it is saved?

Thanks for any help

zelld
06-20-2008, 05:22 AM
being used to photoshop, i wish microsoft would use the ctrl+shift+s combo as the "save as" function... much easier that way.