Athfar Posted January 3, 2008 Posted January 3, 2008 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?
Nahuel Posted January 3, 2008 Posted January 3, 2008 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now