-
Notifications
You must be signed in to change notification settings - Fork 145
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
Application Presentation Type #330
Comments
The If you have issue with the behavior of the PowerPoint API, you can ask on Stack Overflow with the tags |
What about Presentation.Merge? I tried a simple test merging two files and
got a NetOffice exception.
NetOffice.Exceptions.MethodCOMException
HResult=0x80004005
Message=Failed to proceed Method on PowerPoint.Presentation=>Merge.
Source=NetOffice
StackTrace:
at NetOffice.Invoker.Method(ICOMObject comObject, String name, Object[]
paramsArray)
at NetOffice.CoreMethodExtensions.ExecuteMethod(Core value, ICOMObject
caller, String name, Object argument)
at NetOffice.PowerPointApi._Presentation.Merge(String path)
at NetOfficeTesting.Form1.button1_Click(Object sender, EventArgs e) in
D:\kev\temp\NetOfficeTesting\NetOfficeTesting\Form1.cs:line 58
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd,
Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at
System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr
dwComponentID, Int32 reason, Int32 pvLoopData)
at
System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32
reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32
reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at NetOfficeTesting.Program.Main() in
D:\kev\temp\NetOfficeTesting\NetOfficeTesting\Program.cs:line 19
Inner Exception 1:
TargetInvocationException: Exception has been thrown by the target of an
invocation.
Inner Exception 2:
COMException: Unspecified error (Exception from HRESULT: 0x80004005
(E_FAIL))
…On Wed, Oct 6, 2021 at 12:33 PM Jozef Izso ***@***.***> wrote:
The Presentation.Add() method has single WithWindow parameter only:
https://docs.microsoft.com/en-us/office/vba/api/powerpoint.presentations.add
If you have issue with the behavior of the PowerPoint API, you can ask on
Stack Overflow with the tags vba and netoffice or you can contact
Microsoft Support:
https://docs.microsoft.com/en-us/office/vba/articles/feedback-support
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#330 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AL44X2JOUHAL3WJB6QYLDLTUFR25BANCNFSM5FL2QTKA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
@kevin-vanderwende are you able to merge the two presentation files using the PowerPoint UI? |
Yes. What I tried in my test is
ppt.Presentation pres = app.Presentations.Open(@“c:\\test\file1.pptx”,
MsoTriState.msoFalse, MsoTriState.msoFalse, MsoTriState.msoFalse);
pres.Merge(@“c:\\test\file2.pptx”);
That’s when I get an error. I’m not sure this will even do what I’m looking
for. With the SmartArt issue I may have to loop through shapes.
…On Tue, Oct 12, 2021 at 8:13 AM Jozef Izso ***@***.***> wrote:
@kevin-vanderwende <https://github.com/kevin-vanderwende> are you able to
merge the two presentation files using the PowerPoint UI?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#330 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AL44X2LHO27BLKF2SJAPUNLUGQQ5BANCNFSM5FL2QTKA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Is there a way to set the Type when doing app.Presentations.Add? I have an app that loops through a list of files and uses Application.CommandBars.ExecuteMso("PasteSourceFormatting"). It has worked fine until recently one of the presentations contained SmartArt. When those slides are pasted the formatting for the SmartArt is lost.
I've tested this way. I created a new presentation using PowerPoint and manually pasted slides from multiple presentations, including the one with SmartArt and it works fine. I've created a generated file without the SmartArt presentation. Then when I paste in the SmartArt presentation the formatting is lost.
SmartArt file shows this in Windows explorer: application/vnd.openxmlformats-officedocument.presentationml.presentation
My generated file: officedocument.presentationml.presentation
I can save as ppSaveAsOpenXMLPresentation but at that point it is too late. The presentations were pasted into Type officedocument.presentationml.presentation.
I was hoping there is some sort of configuration that can be set programmatically.
The text was updated successfully, but these errors were encountered: