Opening PowerPoint Template using Tcom RRS feed

  • Question

  • Hi,

    I need to open a Powerpoint template using tcom but needs Powerpoint to be minimized or hide. because I am capturing some images and inserting in powerpoint. I am able to open template when the powerpoint is visible that is kept open. I need to do this using tcom. I am using the following code to open the template. Please help me without making it visible how to apply/open template.

    set template_file "D:/Template2.potx"
    set template_file [file nativename [file normalize $template_file]]
    set app [::tcom::ref createobject "Powerpoint.Application"]
    set pres [[$app Presentations] Add]
    $app Visible 1
    $app Activate
    set slides [[$app] ApplyTemplate $template_file]
    ::tcom::foreach lyt [[$pres SlideMaster] CustomLayouts] {
            set lyts([$lyt Name]) $lyt
            puts [$lyt Name]
    set nsld 1
    set newsld [[$pres Slides] AddSlide $nsld $lyts(Title Only)]

    This works as the Powerpoint is kept open but my requirement is to keep the powerpoint invisible/minimized. Please help me.

    Thursday, June 20, 2013 3:05 PM

All replies

  • Hi Rajgary,

    Thank you for posting in the MSDN Forum.

    Is Tcom a 3rd party library? Which language are you using?

    Although I'm not sure about the language and it's syntax, I guess you can try

    $app Visible 0

    Hope it helps.

    Best regards,

    Quist Zhang [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, June 24, 2013 11:58 AM