PDA

View Full Version : FileSaveAs



gmaxey
10-02-2005, 05:55 PM
I am trying to replicate the behavior of the Assistant when you try to save a file as a read only file. When you try this, Word displays the Assistant with a message that the file is read only and list the full path and name of the file the user attempted to save over. I have an error handler that will generate a balloon, but I don't know how to display the name and path of the file the user tried to save over. Any ideas on what should replace the ????? in my code below. Thanks:



Handler:

If Err.Number = 5155 Then

MsgBox ActiveDocument.FullName

Set Balloon = Assistant.NewBalloon

With Balloon

.Icon = msoIconAlert

.Heading = "Microsoft Office Word"

.Text = "This file is read only: " & ???????.FullName

.Button = msoButtonSetOK

.Animation = msoAnimationGetAttentionMajor

.Show

End With

Else

Exit Sub

End If

gmaxey
10-02-2005, 05:56 PM
Can anyone tell me why my code above is preceeded by the font characteristics?

fumei
10-02-2005, 06:06 PM
Not unless you say what you did when you put the text into the post.....

TonyJollans
10-03-2005, 02:24 AM
What's wrong with ActiveDocument just as you have in your MsgBox above it?

Must admit I don't know how to compress the path down to a single line with dots showing for part of the path.