1

I have added an iframe to show a power point diagram on SharePoint classic page. By default it has a some tool bars and other sections in the iframe. I would like to clear all the controls and tool bars so that only the diagram appear on the iframe. I have attempted the below on a script editor but no luck

  <iframe id="myframe" src="https://mydomain.sharepoint.com/sites//PMCMInternational/_layouts/15/Doc.aspx?sourcedoc={c8700571-d499-4dc9-a623-52957080fd9f}&amp;action=embedview&amp;wdAr=1.7755102040816326&amp;Embed=1" width="350px" height="221px" frameborder="0">This is an embedded <a target="_blank" href="https://office.com">Microsoft Office</a> presentation, powered by <a target="_blank" href="https://office.com/webapps">Office</a>.</iframe>


<script>
el = document.getElementById('myframe')
if (el != null) {   
    alert('id :' + el.id)
    if (el.name!=""){
        alert('name: ' + el.name)
document.getElementById("myframe").contentDocument.getElementById("WACStatusBarContainer").style.display="none";
    }
    else{
        alert('frame do not have name attribute')
    }
}else{
    alert('frame do not exist')
}
</script>

As I understand Iframe's css cannot be directly editable can someone guide me on how to proceed?

3
  • SharePoint online? SharePoint Server? I doubt that applies to both. Viso (block chain payment system)? Do you mean Visio (diagram software)? Details matter.
    – teylyn
    Commented Aug 25, 2021 at 5:32
  • Sorry I ment Visio Diagram, Its sharepoint online classic page I have updated the question
    – Rinu
    Commented Aug 25, 2021 at 5:49
  • I am trying the same with Power Point to remove the status bar but its still the same
    – Rinu
    Commented Sep 1, 2021 at 7:26

1 Answer 1

0

It is not possible to do that with javascript/jQuery, because the domains Visio runs on and your code runs on are different, for security reasons. You might want to consider using API Application.showToolbars to control the toolbar.

See reference: https://docs.microsoft.com/en-us/javascript/api/visio/visio.application?view=visio-js-1.1#showtoolbars

1
  • I have added Viso diagram in an iframe as above and used this code on a script editor function hideToolbars() { Visio.run(session, function(context){ var app = context.document.application; app.showToolbars = false; return context.sync().then(function () { window.console.log("Toolbars Hidden"); }); }).catch(function(error) { window.console.log("Error: " + error); }); }; from the reference you have provided, but its does not seems to work. Am I missing somthing?
    – Rinu
    Commented Sep 5, 2021 at 6:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.