Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to insert content controls on numbers within a shape #5009

Closed
Raj-Dev1 opened this issue Oct 28, 2024 · 4 comments
Closed

Unable to insert content controls on numbers within a shape #5009

Raj-Dev1 opened this issue Oct 28, 2024 · 4 comments
Assignees
Labels
Area: Word Issue related to Word add-ins Type: product feature request Office JS ideas that should be posted to aka.ms/m365dev-suggestions (formerly User Voice.)

Comments

@Raj-Dev1
Copy link

Platform: PC desktop
Host: Word
Office version number: Microsoft® Word for Microsoft 365 MSO (Version 2404 Build 16.0.17531.20140) 64-bit
Operating System: Microsoft Windows 11 pro.

I'm unable to insert content controls on numbers within a shape. Is there a way to do this?
I'm attempting to search for numeric patterns (e.g., [0-9.,]{1,}) throughout the document, including inside tables or shapes.

    const body = context.document.body;
    const searchResults = body.search("[0-9]{1,}", { matchWildcards: true });

    // Load the search results
    context.load(searchResults, 'text');
    await context.sync();

    // Loop through the search results and add content controls
    searchResults.items.forEach((item) => {
      const contentControl = item.insertContentControl();
      contentControl.title = "Number Control";
      contentControl.tag = createGuid();
    });

    await context.sync();

While this code successfully returns results for regular tables, it does not work for tables that are embedded within shapes.
Are there any specific properties, methods, or techniques that should be used to handle this scenario?

Expected Behavior:
The searchResults should return matches for numeric patterns within both regular tables and tables inside shapes.

Actual Behavior:
The searchResults return no matches for content inside tables embedded in a shape, even though numeric patterns are present in those tables.

Additional Information:
I have attached the Word document containing the specific table in shape format where the issue occurs for further investigation.
Shape Issue.docx

@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: triage 🔍 New issue, needs PM on rotation to triage ASAP label Oct 28, 2024
@RuizhiSunMS RuizhiSunMS self-assigned this Oct 28, 2024
@RuizhiSunMS RuizhiSunMS added Status: under investigation Issue is being investigated Area: Word Issue related to Word add-ins Status: in backlog Issue is being tracked in the backlog but timeline for resolution is unknown and removed Needs: triage 🔍 New issue, needs PM on rotation to triage ASAP Status: under investigation Issue is being investigated labels Oct 28, 2024
@RuizhiSunMS
Copy link
Contributor

Thank you for reporting this issue, I can repro it. It has been put on our backlog #9486941, the team will investigate and we will reply to you as soon as there is any progress. Thank you for your patience.

@jipyua
Copy link

jipyua commented Oct 30, 2024

hi @Raj-Dev1 thanks for reporting this issue, unfortunately currently there are no Shape and related API for JS API. We track Office Add-in feature requests on our Microsoft 365 Developer Platform Ideas Forum. Please add your request there. Feature requests on are considered when we go through our planning process. At the same time, you may want to check whether Ooxml related API can meet your requirements. Thanks.

@jipyua jipyua added the Needs: author feedback Waiting for author (creator) of Issue to provide more info label Oct 30, 2024
@Raj-Dev1
Copy link
Author

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs: attention 👋 Waiting on Microsoft to provide feedback and removed Needs: author feedback Waiting for author (creator) of Issue to provide more info labels Oct 30, 2024
@RuizhiSunMS
Copy link
Contributor

Ack. Thx for your submit.

@RuizhiSunMS RuizhiSunMS added Type: product feature request Office JS ideas that should be posted to aka.ms/m365dev-suggestions (formerly User Voice.) and removed Needs: attention 👋 Waiting on Microsoft to provide feedback labels Oct 30, 2024
@RuizhiSunMS RuizhiSunMS removed the Status: in backlog Issue is being tracked in the backlog but timeline for resolution is unknown label Jan 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Word Issue related to Word add-ins Type: product feature request Office JS ideas that should be posted to aka.ms/m365dev-suggestions (formerly User Voice.)
Projects
None yet
Development

No branches or pull requests

3 participants