' This is an example iLogic rule by Luke Davenport on Cadline Community ' It creates a 'folder browser dialog' to allow user to pick a directory location ' This selected directory location is then used for a generic PDF export operation ' Please modify to suit your requirements.... Imports System.Windows.Forms ' Get current location of this file Dim ExportPath As String = ThisDoc.Path ' Check that this file has been saved and actually exists on disk If String.IsNullOrEmpty(ExportPath) Then MsgBox("This file has not yet been saved and doesn't exist on disk! - please save it first",64, "Cadline iLogic") Return End If ' Define folder browse dialog Dim Dialog = New FolderBrowserDialog() ' Set options for folder browser dialog Dialog.SelectedPath = ExportPath Dialog.ShowNewFolderButton = True Dialog.Description = "Cadline - Choose Folder for Export..." ' Show dialog box If DialogResult.OK = Dialog.ShowDialog() Then ' User clicked 'ok' on dialog box - capture the export path ExportPath = Dialog.SelectedPath & "\" Else ' User clicked 'cancel' on dialog box - exit Return End If ' Define the filename of the file to be exported - in this case it is a PDF file extension ExportFilename = "EXAMPLE EXPORTED FILE NAME" & ".pdf" ' Do export operation (using save as) Try ThisDoc.Document.SaveAs(ExportPath & ExportFilename, True) Catch MsgBox("File export failed...", 64, "Cadline iLogic") End Try ' Ask user if they want to open (launch) the file we just exported... If MsgBox("File exported: " & _ ExportPath & ExportFilename & vbLf & vbLf & _ "Do you want to open the PDF Now?", 36, "Cadline iLogic - File Exported") = 6 Then ' User says yes...launch exported file ThisDoc.Launch(ExportPath & ExportFilename) End If