I have encountered an Issue where I save my PDF to a "Specified Folder" on my local computer by Application.Name.
Example: Name of Doc. Is "Test"
Test.cdr but when I save my PDF out by Application.Name it save its as Test.cdr.pdf when I really need it as test.pdf
How do I eliminate the .cdr extension from the name? Or is that even possible? Ignore the 'comment blocks. We work remotely from a special program that auto adds dsn numbers to a proof (which is why Im trying to fix the name issue) But local desktop cannot because program only exists on remote server. So I have to manually add dsn number there if I work from Local.
Private Sub cmdPDF_Click()On Error Resume NextActiveDocument.PublishToPDF folderPath & ActiveDocument.Name & ".pdf" ' pull from name from active document on remote system for ledger '''ActiveDocument.PublishToPDF folderPath & TextBox8.Text & ".pdf" 'manually add in info for ledger(local desktop)End Sub
Public Function folderPath() As StringfolderPath = CreateObject("WScript.Shell").SpecialFolders("") & "\\ac-fs1\F\Artproofs1\ModularTiles Proofs\Design_"End Function
Think you can help???
CDT said: ActiveDocument.PublishToPDF folderPath & ActiveDocument.Name & ".pdf" ' pull from name from active document on remote system for ledger
ActiveDocument.PublishToPDF folderPath & ActiveDocument.Name & ".pdf" ' pull from name from active document on remote system for ledger
Try to change ActiveDocument.Name & ".pdf to this
ActiveDocument.PublishToPDF Left$(ActiveDocument.FullFileName, Len(ActiveDocument.FullFileName) - 4) & ".pdf"
Best regards
Mek
Okay, Great Reference! Thank you Mek :)
Private Sub cmdPDF_Click()
On Error Resume Next
ActiveDocument.PublishToPDF folderPath & Left$(ActiveDocument.Name, Len(ActiveDocument.Name) - 4) & ".pdf" ' I changed this a bit.
End Sub
Public Function folderPath() As String
folderPath = CreateObject("WScript.Shell").SpecialFolders("") & "\\ac-fs1\F\Artproofs1\ModularTiles Proofs\"
End Function
With ActiveDocument.FullFileName ... It was saving the file name out correctly but in the same folder as the .cdr file. I didnt need that. I needed the pdf to save somewhere else but w/o the .cdr extension in the name. So me making these little changes based off your reference code seemed to work!
Assuimg that your specified path /folder is stored on "folderPath" then
change ActiveDocument.PublishToPDF folderPath & ActiveDocument.Name & ".pdf
to ActiveDocument.PublishToPDF folderPath & Left$(ActiveDocument.FileName, Len(ActiveDocument.FileName) - 4) & ".pdf"