Amit
Amit

Reputation: 55

Navigate to next document without saving any changes in last document in AxWebBrowser

I am opening MS Office Document file in AxWebBrowser after that I navigate to next Office Document ,before navigating I saved the last document like this

AxWebBrowser1.ExecWB(SHDocVw.OLECMDID.OLECMDID_SAVE, SHDocVw.OLECMDF.OLECMDF_ENABLED)

but how can I navigate to next Document without saving it even if it also have any changes?

if I do not use above line of code it ask for "Save","Don't Save" and "Cancel" before navigating to next document.

help me thanks

Upvotes: 1

Views: 92

Answers (2)

leighton
leighton

Reputation: 11

You could kill all Excel and Winword processes before opening the next:

    Try
        For Each prog As Process In Process.GetProcesses
            If prog.ProcessName = "EXCEL" Then prog.Kill()
            If prog.ProcessName = "WINWORD" Then prog.Kill()
        Next
    Catch
        err("Error Closing files")
    End Try

Upvotes: 1

Md5 Software
Md5 Software

Reputation: 62

Maybe try to reload the page first make sure to use reload and not refresh because refresh will only apply changes that aren't loaded.

Upvotes: 0

Related Questions