Consulting

Results 1 to 4 of 4

Thread: FileSaveAs

  1. #1
    Microsoft Word MVP 2003-2009 VBAX Guru gmaxey's Avatar
    Joined
    Sep 2005
    Posts
    3,340
    Location

    FileSaveAs

    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:

    [VBA]

    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

    [/VBA]
    Greg

    Visit my website: http://gregmaxey.com

  2. #2
    Microsoft Word MVP 2003-2009 VBAX Guru gmaxey's Avatar
    Joined
    Sep 2005
    Posts
    3,340
    Location
    Can anyone tell me why my code above is preceeded by the font characteristics?
    Greg

    Visit my website: http://gregmaxey.com

  3. #3
    VBAX Wizard
    Joined
    May 2004
    Posts
    6,713
    Location
    Not unless you say what you did when you put the text into the post.....

  4. #4
    VBAX Master TonyJollans's Avatar
    Joined
    May 2004
    Location
    Norfolk, England
    Posts
    2,291
    Location
    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.
    Enjoy,
    Tony

    ---------------------------------------------------------------
    Give a man a fish and he'll eat for a day.
    Teach him how to fish and he'll sit in a boat and drink beer all day.

    I'm (slowly) building my own site: www.WordArticles.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •