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
Keeping it simple, you could do something like this:
Sub SirSaveALot() Dim d As Document Dim p As Page Dim sa As New StructSaveAsOptions sa.Range = cdrSelection Set d = ActiveDocument d.SaveAs "C:\Temp\Save\AllPages.Cdr" For Each p In d.Pages p.Activate p.Shapes.All.CreateSelection d.SaveAs "C:\Temp\Save\" & p.Name & "\" & p.Name & ".cdr", sa Next p End Sub
Hope that gets you started.
-Shelby
sir just like this can we also export few selected pages of a document and save as a cdr file .?
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
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