-
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Great script, but what about source format? #1
Comments
Hi, can you provide a zip with a sample case? (some small PPTs) |
The code that inserts the slides is here: it does:
aka it calls https://docs.microsoft.com/en-us/office/vba/api/powerpoint.slides.insertfromfile
A question is, does PowerPoint allow you to manually do the operation (say with two PPTs) and get the result in the way you expect? If it does, then I can easily guide you into recording a macro and we can check out what VBA code that macro generates If you mean that all the concatenated result uses some style from the 1st powerpoint document (into which the rest are inserted to produce a new file), then I remember I had a similar issue with Word which resulted in a different insertion strategy (via copy and special paste): https://github.com/Zoomicon/tranXform/blob/master/src/DOCmerge/DOCmerge.vbs#L49
maybe we could try the same or similar logic there, say something like:
if that doesn't work we can try the macro recording route I was speaking about above to see what code is generated when you copy-paste slides from one presentation to another |
Unfortunately the macro recorder (which was quite a handy tool) has been removed from PP2013 and up. What version of PowerPoint are you using?
|
Just noticed :'( |
Tried changing the code in the VBS-file for Sub ProcessFile(filename) to the example code for similar logic from above, but it didn't work. |
I did find related discussion and some promising code that could be adapted to VBA |
Will check that out. |
Wow... Good information but i don't think, me coding this will save any time at all :'D |
Will try adapting on the fly that code sample below, hope I don't do any mistakes... |
let's see:
|
did some more formatting above, let me know if you try it out. Probably it works in newer VBA only (since I see With being used), although one could adapt it for older VBA too if it doesn't support With by using variables with Dim x / Set x=... / Set x=Nothing and use x.something instead of .something at those statements inside with blocks |
probably you could remove some parts and just keep
|
Btw, found another interesting discussion with C# code sample (with many broken links in it afaik) that may have some extra workarrounds for specific lost-styling issues during the programmatic copy-pasting of slides. That is if one wanted to build a bullet-proof PPT merging tool. My original usecase was to merge presentations that had all been authored based on the same source powerpoint so that they could be presented in a certain order all together. |
it says syntax error at that line/col, what code is there at that line now that you changed the file? |
did you have any progress? I'd suggest first trying a smaller version of the proc:
or even better without the "with" which might not be supported in VBScript that one runs from the command-line (but only in VBA for marcros running inside Office that is)
|
I've merged 27 pptx-files with success and with a big smile on my lips only to notice it doesn't take into account the source formatting. Damn... I thought I'd find the perfect solution since this worked soooooo good and was so fast. I really thought I'd save a lot of time with this...
Any plans or suggestions on how to activate source formatting for all merged PPTX-files?
Best regards // Johan
The text was updated successfully, but these errors were encountered: