Coder Social home page Coder Social logo

Comments (5)

AkhileshShah-MS avatar AkhileshShah-MS commented on August 10, 2024

Hi @CaptainTammy ! Thanks for reaching out to us.
Looping in @EsterBergen to help with the issue.
Thanks!

from office-js.

EsterBergen avatar EsterBergen commented on August 10, 2024

@CaptainTammy - thanks for submitting. We'll look into this and respond soon.

from office-js.

EsterBergen avatar EsterBergen commented on August 10, 2024

@CaptainTammy -Is this specific to one platform or a version?
Can you provide details about the environment?

Your Environment
Platform [PC desktop, Mac, iOS, Office on the web]:
Host [Excel, Word, PowerPoint, etc.]: Powerpoint
Office version number:
Operating System:
Browser (if using Office on the web):

from office-js.

CaptainTammy avatar CaptainTammy commented on August 10, 2024

@EsterBergen
I don't think this is platform specific as we have encountered it on both Windows and Mac versions while developing.

Environment
Platform [PC desktop, Mac, iOS, Office on the web]: PC, Mac
Host [Excel, Word, PowerPoint, etc.]: Powerpoint
Office version number: Mac 16.82, Windows 2401
Operating System: MacOS, Windows
Browser (if using Office on the web): NA

from office-js.

andriy101 avatar andriy101 commented on August 10, 2024

Here are the repro steps:

  • Create presentation with one slide, which have a tile text box as first shape.
  • Add any web based add-in, for example web viewer
  • In add-in's console run:
PowerPoint.run(async context => {
    const slide = context.presentation.slides.getItemAt(0);
    slide.shapes.load('items');
    await context.sync();
    const shape = slide.shapes.items.at(0);
    shape.load('*');
    await context.sync();
    shape.textFrame.textRange.text = 'FIRST-LINE\nSECOND-LINE';
});
  • Previous code should insert header FIRST-LINE\nSECOND-LINE in two lines
  • Now try to read it, run in console:
Office.context.document.getSelectedDataAsync(Office.CoercionType.SlideRange, asyncResult => {
    if (asyncResult.status === Office.AsyncResultStatus.Failed) {
        console.log('ERR');
    } else {
        console.log('SUCCESS', asyncResult.value.slides[0]);
    }
});
  • no console log will be printed, code is stuck and nothing happens
  • if I use \r instead of \n, everything works as expected.

Some resource: https://www.rdpslides.com/pptfaq/FAQ00992_Paragraph_endings_and_line_breaks.htm

I wonder, if we may have similar issues in another Office APIs...

from office-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.