I would like to know if you could please share your default "Save As" dialog code.
I had to add a customer handler to the SaveAs cmd in order to check the file path and prompt the user if the current document contains a certain string in that file path, kind of as a warning.
In doing so, all I get is a stripped down version of the save dialog and I have to set all the settings again and catch certain cases, etc. For example, I'd like it to prompt me when I go to save a document with a name that would overwrite an existing document, like it's supposed to. So if you had your default Save As code to share that would save me loads of trouble.
Right now, this is what I have so far in my Command Handler, it's messy but I was just playing around with it and started to realize there are a few things to account for, so figured I would as you guys if you could share:
Code: Select all
If pCmd.ID = nSaveAsID Then
If nCode = CInt(PDFXEdit.UIX_CmdNotifyCodes.UIX_CmdNotify_Exec) Then
Dim sad As New SaveFileDialog()
If frmMain.pdfCtrl.Inst.ActiveDoc IsNot Nothing Then
Dim CurrentDoc As IPXV_Document = frmMain.pdfCtrl.Inst.ActiveDoc
Dim sPath As String = CurrentDoc.CoreDoc.SrcInfo.ActualFileName
If sPath.ToLower.Contains("stuff") Then
frmMain.pdfCtrl.Inst.ShowMsgBox("stuff","stuff","stuff")
End If
End If
sad.Filter = "PDF Files (*.pdf)|*.pdf"
sad.FilterIndex = 1
sad.DefaultExt = "pdf"
sad.AddExtension = True
sad.FileName = frmMain.pdfCtrl.Inst.ActiveDoc.CoreDoc.SrcInfo.DispFileName
If sad.ShowDialog() = DialogResult.OK Then
frmMain.pdfCtrl.Inst.ActiveDoc.Save()
End If
End If
End If
Doc.It Development