In the MyCad tools (which you can have) you should find what you are looking for with Integration, it allows you to save in pdf by retrieving different properties and establishing several rules.
Possibility to save a MEP in a different format, to export each sheet in 1 same file or not.
Rename a file with properties.
Possibly complete a property based on an excel file...
The possibilities are very vast and accessible without any knowledge of macro.
I already have a macro processing that I do previously and that I would integrate before into the future macro, so that my macro will do everything at once.
I've already looked and downloaded a lot of subject and macro on this with example macro
I've already tinkered with one but I can't finalize, the save as window is not the right one, my file name is the same as the name of my original file, it's not what I would like.
I'd rather use a macro than rather Integration, I have several people who don't know about integration who will use it next.
This kind of macro requires a little time for development and development. As for the use of the save as window of SW it is not necessarily the most practical because its control via the APIs is not optimal if my memory is correct.
Control of the object if someone clicks on cancel and retrieve the record name. The easiest way to my knowledge is to open a basic explorer window to select a path, retrieve it as a parameter and manage the record (formatting the name...) directly via the macro code.
See if the attached macro suits you, the code remains to be secured with error handling....
If you insert this code in another macro, be sure not to forget to add the reference "Microsoft Shell Controls And Automation" to be able to use the "BrowseForFolder" to select the destination folder of the PDFs.
Thank you d.roger your macro is really not bad. In the meantime I found another function where I pre-filled the destination path:
Function BrowseFolder(Optional Caption As String, _ Optional InitialFolder As String) As String
Dim SH As Shell32.Shell Dim F As Shell32.Folder
Set SH = New Shell32.Shell 'Set F = SH. BrowseForFolder(0&, Caption, BIF_RETURNONLYFSDIRS, InitialFolder) Set F = SH. BrowseForFolder(0&, Caption, BIF_RETURNONLYFSDIRS, "K:\Doc\" & Nummach)
If Not F Is Nothing Then BrowseFolder = F.Items.Item.Path End If