Copy Paste Slide Powerpoint conserve source format

Hello,

I am tring to use the activity Copy Paste slide from UiPath.Presentations.Activities to copy all slides from a .ppt file to another file, but the problem I am facing is that the paste options are not available and so the content is pasted with the destination format. I would like to keep the source format of the slides.
Does anyone have been is this case and have found a solution ?

Thanks

image

@sinanhartlap

Please check this…you can try in invoke code

cheers

1 Like

@Anil_G

Thank you for the response, I try to launch this script below to acheive the copy of the slides regarding to the link you shared but I have a compiled error : BC30574 Option Strict on Disallows late binding. In fact I am not really familiar with VB, does anyone can help me with this script ?
Thanks

Dim objPPT = CreateObject("PowerPoint.Application")
objPPT.Visible = True

Dim TemplatePresentation = objPPT.Presentations.Open(PPTTemplateFileName)
Dim AttachmentPresentation = objPPT.Presentations.Open(PPTAttachmentFileName)

TemplatePresentation.Visible = True
AttachmentPresentation.Visible = True

TemplatePresentation.Presentations.Open(PPTTemplateFileName)
AttachmentPresentation.Presentations.Open(PPTAttachmentFileName)

TemplatePresentation.Slides.Range.Copy
AttachmentPresentation.Windows(intSlide).Activate
AttachmentPresentation.Application.CommandBars.ExecuteMso("PasteSourceFormatting")

TemplatePresentation.Save
AttachmentPresentation.Save

TemplatePresentation.Close
AttachmentPresentation.Close

objPPT.Quit

Below the activity with arguments

Hello,

Please find the code which works below :

Dim objPPT As Microsoft.Office.Interop.PowerPoint.Application
objPPT = New Microsoft.Office.Interop.PowerPoint.Application
objPPT.Visible = Microsoft.Office.Core.MsoTriState.msoTrue

Dim TemplatePresentation As Microsoft.Office.Interop.PowerPoint.Presentation
TemplatePresentation = objPPT.Presentations.Open(PPTTemplateFileName)

Dim AttachmentPresentation As Microsoft.Office.Interop.PowerPoint.Presentation
AttachmentPresentation = objPPT.Presentations.Open(PPTAttachmentFileName)

AttachmentPresentation.Slides.Range.Copy

TemplatePresentation.Windows(1).Activate
TemplatePresentation.Slides(intSlide).Select()

TemplatePresentation.Application.CommandBars.ExecuteMso("PasteSourceFormatting")

TemplatePresentation.Save
AttachmentPresentation.Save

TemplatePresentation.Close
AttachmentPresentation.Close

objPPT.Quit

Regards

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.