I Need Help... It's been a while since i've reached out.
I have a Document with 2 pages.
I need each (document , page 1 & page 2) to all save in different locations with one click.
Example: Upon pressing command button...
Currently I have 3 command buttons saving each out individually. I want to consolidate but need direction. Any help is appreciated.
Chieri
I think I was going for this... I was working on this over the weekend... I Don't believe selecting objects to export is necessary since im focusing on what's on the page. I'm not sure if this is the right way to do this!
Dim doc As Document
Set doc = ActiveDocument
'On Error GoTo ErrHandler Optimization = True With doc.PDFSettings .Metadata.Notes = Textbox1 .PublishRange = 1 ' CdrPDFVBA.pdfCurrentPage .PageRange = "2" .Author = "CT" .Subject = Textbox2 .Keywords = "" End With
doc.Pages(1).Activate ' Art Proof On Error Resume Next ActiveDocument.PublishToPDF "C:\Users\cthompson\Pictures\My Proofs\" & Textbox1 & ".pdf" doc.Pages(2).Activate ' FlexiSign On Error Resume Next ActiveDocument.PublishToPDF "C:\Users\cthompson\Pictures\My Proofs\" & Textbox2 & ".pdf" doc.Pages(1).Activatedoc.Save'doc.Close
ExitSub: Optimization = False ActiveWindow.Refresh Application.Refresh ActiveDocument.EndCommandGroup Exit Sub
ErrHandler: MsgBox "Um. Some *** Aint Working!" '& vbCr & Err.Description Resume ExitSub
Yes. And you just obtained something else then requested...
Shelby solved your request involving whole cdr and each page saving as you asked. If you need pdf files, or pdf is also acceptable, no problem, you can use them applying this solution.
Got it - thanks. Working on it.
If you use PublishToPdf you have to submit a file name including path. And this path has no relation to the location of your *.CDR-Document. Also the setting of PublishRange has no impact to the CDR-Document. So your script is almost on the right way, you simply need to change:ActiveDocument.PublishToPDF "C:\Users\cthompson\Pictures\My Proofs\" & Textbox2 & ".pdf"toActiveDocument.PublishToPDF "C:\Users\cthompson\Pictures\Folder1\" & Textbox1 & ".pdf"orActiveDocument.PublishToPDF "D:\Temp\2017\OutTest\" & Textbox2 & ".pdf"And Doc.Save will save the document on it's original location. So you have saved all 3 items in different locations.
Yup! Thank you Shelby. This did help
Dim doc As Document Dim pge As Page Set doc = ActiveDocument doc.SaveAs "C:\Users\cthompson\Pictures\My Proofs\Proof Files\" & "DesignNumber" & ".cdr" For Each pge In doc.Pages pge.Activate doc.PublishToPDF "C:\Users\cthompson\Pictures\My Proofs\" & pge.Name & ".pdf" Next pge