locked
PlaceholderType: Mixed RRS feed

  • Question

  • In Microsoft Interop PowerPoint library, I found a PlaceholderType named “Mixed”. Can you please explain me the purpose and uses of this “Mixed” type placeholder?

    Please check the below code snippet for your reference.

    Thanks,

    Arun

    PowerPoint.Application ppApplication = null;

    ppApplication = new PowerPoint.Application();

    var Presentations = ppApplication.Presentations;

    var Presentation = Presentations.Open(@"Input.pptx", Office.MsoTriState.msoTrue, Office.MsoTriState.msoTrue, Office.MsoTriState.msoTrue);

    var Slides = Presentation.Slides;

    var slidee = Slides[1];

    var shapes = slidee.Shapes;

    shapes.AddPlaceholder(Microsoft.Office.Interop.PowerPoint.PpPlaceholderType.ppPlaceholderMixed, 100, 100, 100, 100);

    Presentation.Save();

    Friday, August 14, 2015 12:57 PM

Answers

  • Hi Arun

    Please don't "spam" the forum with multiple, duplicate questions. You'll get a reply when someone comes across a post and thinks he has an answer, or when the Chinese "staff" are on-duty (and have an idea). If you need immediate help, paid support is the way to go.

    In Office, the "mixed" type of enumeration are read-only: when there's a selection or a collection of objects of the same basic class, but with varying properties, so that they don't all fit the same Enum then the Office application will return a type mixed. You cannot use this for creating/inserting a new object.


    Cindy Meister, VSTO/Word MVP, my blog

    Friday, August 14, 2015 2:30 PM

All replies

  • In Microsoft Interop PowerPoint library, I found a PlaceholderType named “Mixed”. Can you please explain me the purpose and uses of this “Mixed” type placeholder?

    Please check the below code snippet for your reference.

    Thanks,

    Arun

    PowerPoint.Application ppApplication = null;

    ppApplication = new PowerPoint.Application();

    var Presentations = ppApplication.Presentations;

    var Presentation = Presentations.Open(@"C:\Users\arunprasadm\Desktop\Demos\PPTSample (2)\PPTSample\bin\Debug\Input.pptx", Office.MsoTriState.msoTrue, Office.MsoTriState.msoTrue, Office.MsoTriState.msoTrue);

    var Slides = Presentation.Slides;

    var slidee = Slides[1];

    var shapes = slidee.Shapes;

    shapes.AddPlaceholder(Microsoft.Office.Interop.PowerPoint.PpPlaceholderType.ppPlaceholderMixed, 100, 100, 100, 100);

    Presentation.Save();

    Friday, August 14, 2015 12:47 PM
  • I am unable to add the placeholder to the slide, while normally opening a “*.pptx” file, I got the exception as in the below screenshot.

    i am getting InValid enumeration exception

    Thanks,

    Arun

    Friday, August 14, 2015 12:50 PM
  • I am unable to add the placeholder to the slide, while normally opening a “*.pptx” file,

    i am getting invalid enumeration value exception.

    Thanks,

    Arun

    • Moved by CoolDadTx Friday, August 14, 2015 6:03 PM Office related
    • Merged by Cindy Meister MVP Sunday, August 16, 2015 2:18 PM same issue
    Friday, August 14, 2015 12:52 PM
  • I am unable to add the placeholder to the slide, while normally opening a “*.pptx” file,

    i am getting invalid enumeration value exception.

    Thanks,

    Arun

    Friday, August 14, 2015 12:52 PM
  • Can't see the screenshot.

    Healy in Tampa


    Joe Healy, Tampa, FL

    Friday, August 14, 2015 12:54 PM
  • The PlaceholderType enumeration it has been mentioned that, byte value for the “Mixed” as -2. Can you explain me the reason regarding this value?

    In microsoft interop powerpoint

    Friday, August 14, 2015 12:54 PM
  • The PlaceholderType enumeration it has been mentioned that, byte value for the “Mixed” as -2. Can you explain me the reason regarding this value?

    In microsoft interop powerpoint

    Thanks,

    Arun

    • Moved by CoolDadTx Friday, August 14, 2015 6:11 PM Office related
    • Merged by Cindy Meister MVP Sunday, August 16, 2015 2:12 PM same issue
    Friday, August 14, 2015 12:55 PM
  • The PlaceholderType enumeration it has been mentioned that, byte value for the “Mixed” as -2. Can you explain me the reason regarding this value?

    In microsoft interop powerpoint

    Thanks,

    Arun

    Friday, August 14, 2015 12:56 PM
  • In Microsoft Interop PowerPoint library, I found a PlaceholderType named “Mixed”. Can you please explain me the purpose and uses of this “Mixed” type placeholder?

    Please check the below code snippet for your reference.

    Thanks,

    Arun

    PowerPoint.Application ppApplication = null;

    ppApplication = new PowerPoint.Application();

    var Presentations = ppApplication.Presentations;

    var Presentation = Presentations.Open(@"Input.pptx", Office.MsoTriState.msoTrue, Office.MsoTriState.msoTrue, Office.MsoTriState.msoTrue);

    var Slides = Presentation.Slides;

    var slidee = Slides[1];

    var shapes = slidee.Shapes;

    shapes.AddPlaceholder(Microsoft.Office.Interop.PowerPoint.PpPlaceholderType.ppPlaceholderMixed, 100, 100, 100, 100);

    Presentation.Save();

    Friday, August 14, 2015 12:57 PM
  • You can use the MSDN Library Search Engine to search for information you want to know about.

    SlideRange Object (PowerPoint)

    "Setting the value of a property of the SlideRange collection is equivalent to setting the value of the property in each slide in that range individually (for a property that takes an enumerated type, setting the value to the "Mixed" value has no effect).

    A property of the SlideRange collection that returns an enumerated type returns the value of the property for an individual slide in the collection if all slides in the collection have the same value for that property. If the slides in the collection don't all have the same value for the property, the property returns the "Mixed" value."


    La vida loca

    Friday, August 14, 2015 2:01 PM
  • Hi Arun

    Please don't "spam" the forum with multiple, duplicate questions. You'll get a reply when someone comes across a post and thinks he has an answer, or when the Chinese "staff" are on-duty (and have an idea). If you need immediate help, paid support is the way to go.

    In Office, the "mixed" type of enumeration are read-only: when there's a selection or a collection of objects of the same basic class, but with varying properties, so that they don't all fit the same Enum then the Office application will return a type mixed. You cannot use this for creating/inserting a new object.


    Cindy Meister, VSTO/Word MVP, my blog

    Friday, August 14, 2015 2:30 PM
  • It would help if you provided a link to the documentation on the enumerated type you are talking about.

    Though at the end of the day, it shouldn't matter what the byte value is for an enumeration, as the entire point of an enumeration is so you can refer to the elements by a readable name rather a number.

    In this case I would guess its just for some historical reason or a 'special value' for the enumerated type if all other values are positive values (a negative number essentially means the left-most bit is set).

    • Proposed as answer by Christopher84 Friday, August 14, 2015 6:12 PM
    Friday, August 14, 2015 2:33 PM
  • Hello,

    I am moving this to the C# forum as your code is C#, not VB.NET


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my webpage under my profile but do not reply to forum questions.

    Friday, August 14, 2015 3:27 PM
  • Hello,

    I am moving this to the C# forum as your code is C#, not VB.NET


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my webpage under my profile but do not reply to forum questions.

    I don't think the code is relevant, this seems to be a question about the PowerPoint Object Model.
    Friday, August 14, 2015 3:29 PM
  • Plus, this question has been double-posted
    Friday, August 14, 2015 3:47 PM
  • And is this connected to your other post? You seem to be posting the same question in several different variations.

    You didn't supply any code here that would enable anybody to answer the question, but assuming this is the same issue as your other post then please see my comment there, which may provide the answer.

    Friday, August 14, 2015 4:00 PM
  • As RJP said.

    For all intents Enumerations are just a collection of Compile Time constants. Behind every Enumration is just a integer type.
    Indeed I once simulated/replaced Enumerations by just having a class with a bunch of constants. Biggest difference was that somebody could assign invalid values to the integer variable, while Enumeration types are protected against miss-assignment.

    Friday, August 14, 2015 6:15 PM