Jump to content

Recommended Posts

Posted

If WinExists("Save PDF File As", "&Yes") Then           

            If $overwrite_file == 1 Then
                MsgBox(1,"True","Should click Yes")
            ;ControlClick("Save PDF File As", "&Yes", "Button1")
            ElseIf $overwrite_file == 0 Then
                MsgBox(1,"No","Should click No")
                ControlClick("Save PDF File As", "&Yes", "Button2")
            Else 
                MsgBox(52,"Error","A file already exists! Do you wish to force overwrite for all files?")
                If @error == 6 Then
                    $overwrite_file = 1
                    MsgBox(1,"True","Should click Yes")
                ;ControlClick("Save PDF File As", "&Yes", "Button1")
                Else
                    $overwrite_file = 0
                    MsgBox(1,"No","Should click 1No")
                ;ControlClick("Save PDF File As", "&Yes", "Button2")
                EndIf
            EndIf
            
        EndIf

Why is it when I hit Yes for MsgBox(52,"Er.... it doesn't make @error 6 thus setting $overwrite_file = 1?

Posted

If you see the help file, you'll see that MsgBox() doesn't set any value to @error. This is how it works.

$Ans=MsgBox(52, "Error", "A file already exists! Do you wish to force overwrite for all files?")
        If $Ans == 6 Then

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...