none
Accessing the PictureFill properties of PowerPoint presentation using Microsoft.Office.Interop.PowerPoint.dll in C# RRS feed

  • Question

  • Hi,

    I need to use the below highlighted properties of PictureFill in interop PowerPoint. I am trying this in C#. I found the below codes to set the slide background using Fill property.

    slide = presentation.Slides[1];

    slide.FollowMasterBackground = MsoTriState.msoFalse;           

    slide.Background.Fill.UserPicture("Image.jpg");

    Now the picture is stretched and center aligned. But I could not access the bounds as highlighted in the below screenshot,

    I expect any API to be as below.

    slide.Background.Fill.TextureTile = MsoTriState.msoFalse; // I hope this is to set the check box in above screenshot (Tile picture as texture)

    slide.Background.Fill.OffSetLeft // I could not find this API

    slide.Background.Fill.OffSetRight // I could not find this API

    slide.Background.Fill.OffSetTop // I could not find this API

    slide.Background.Fill.OffSetBottom // I could not find this API

    Any one of you help me to do this.         

    Thanks in advance.

    Thanks,


    Meikandan

    Monday, October 16, 2017 7:07 AM

All replies

  • Hi,

    I need to use the below highlighted properties of fill in interop PowerPoint. I am trying this in C#. I found the below codes to set the slide background,

    slide = presentation.Slides[1];

    slide.FollowMasterBackground = MsoTriState.msoFalse;           

    slide.Background.Fill.UserPicture("Image.jpg");

    Now the picture is stretched and center aligned. But I could not update the bounds of the background image.

    In Microsoft PowerPoint user interface, I can achieve this by using the below properties,

    Offset left

    Offset right

    Offset top

    Offset bottom

    We can see this properties in Microsoft PowerPoint user interface under format background.

    Note:

    These properties are enable only if the Tile picture as texture checkbox is false.

    What are the properties in interop to achieve this similar behavior.

    Any one of you help me to do this.

    Thanks in advance.

    Thanks,

    M.Ramaraj.

    Monday, October 16, 2017 6:40 AM
  • Hello M.Ramaraj,

    According to your question is more related to office , I will move the thread to General Office Development for suitable support.

    The Visual C# discuss and ask the C# programming language, IDE, libraries, samples and tools . If you have some grammar or code errors, please feel free to contact us. We will try our best to give you a solution .

    Sincerely,

    Neil Hu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, October 17, 2017 3:08 AM
  • Hi Meikanda Nayanar,

    In fact, slide.Background.Fill is a FillFormat object. I checked members of the FillFormat object but not got any property/method to change the options like the picture.

    However, these options will be changed after setting check box Tile picture as texture. If you want to set options like below picture, they are able to be set.


    Here is the example code.

         

    PPT.FillFormat fillFormat = slide.Background.Fill;
    
                fillFormat.TextureTile = Microsoft.Office.Core.MsoTriState.msoTrue;
    
                fillFormat.TextureOffsetX = 10;
    
                fillFormat.TextureOffsetY = 20;
    
                fillFormat.TextureHorizontalScale = (float)0.8;
    
                fillFormat.TextureVerticalScale = (float)0.9;

    Best Regards,

    Terry


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, October 17, 2017 7:18 AM
  • Hi Terry,

    Both the properties I asked for and those you have updated serves different purposes.

    Tile picture as texture check box disabled

    Tile picture as texture check box enabled

    I am particularly interested in finding the API for “Tile picture as texture” disabled mode. I thought, I can do every operation in Microsoft PowerPoint application(UI) can be achieved with "Microsoft.Office.Interop.PowerPoint.dll". Am I wrong? Or this is a different case?

    Thanks



    Meikandan

    Thursday, October 19, 2017 5:21 AM
  • Hi Meikandan,
    I think we are unable to change them programmatically. Not all settings could be changed programmatically. The properties might not be exposed. 
    Thanks for understanding.
    Best Regards,
    Terrty

    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, October 20, 2017 10:18 AM