-
I've often simply used the test of...
[vba]
If ActiveDocument.Name = ActiveDocument.FullName Then
'document has not yet been saved anywhere
Else
'document has been saved at some point
End If
[/vba]
That can obviously be optimized by using Len, but I only optimize when it is more important than readability.
Since .FullName gives the path and the name, that's my standard test to see if there is a path. Could also test to see if .Path is equal to a vbnullstring, etc. Lots of different approaches... but Paul_Hossler makes a good point, although not necessarily one the OP considered, as there is no file extension on an unsaved document.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules