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

Unclear how I should find text from textboxes in a Word document #5282

Open
15MariamS opened this issue Jan 14, 2025 · 9 comments
Open

Unclear how I should find text from textboxes in a Word document #5282

15MariamS opened this issue Jan 14, 2025 · 9 comments
Assignees
Labels
Area: Word Issue related to Word add-ins Type: product question Question about the Office Add-ins platform or Office JavaScript APIs

Comments

@15MariamS
Copy link

Article URL
On what page did you find the problem?

https://learn.microsoft.com/en-us/javascript/api/word/word.body?view=word-js-preview#word-word-body-shapes-member

Describe the problem
A clear and concise description of what is incorrect, unclear, or missing in the document.

From that page, I understand that the only way to get the text content from the Word API is from Word.Shape (i.e. I can't use Word.Document.Body), but the documentation for that says the following:

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Given this, I'm not sure how to extract text from a textbox.

Screenshots
If applicable, add screenshots to help explain your problem.

@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: triage 🔍 New issue, needs PM on rotation to triage ASAP label Jan 14, 2025
@Rick-Kirkham Rick-Kirkham added Area: Word Issue related to Word add-ins Needs: attention 👋 Waiting on Microsoft to provide feedback and removed Needs: triage 🔍 New issue, needs PM on rotation to triage ASAP labels Jan 14, 2025
@Rick-Kirkham
Copy link
Contributor

@ElizabethSamuel-MSFT Can you take a look?

@ElizabethSamuel-MSFT ElizabethSamuel-MSFT transferred this issue from OfficeDev/office-js-docs-reference Jan 16, 2025
@ElizabethSamuel-MSFT
Copy link
Contributor

@15MariamS Thanks for asking about this. I've transferred this issue from the documentation repo to the product repo so the feature crew can investigate.

@ElizabethSamuel-MSFT
Copy link
Contributor

@RuizhiSunMS Can you take a look and assign appropriately? Thanks.

@guoms1 guoms1 assigned guoms1 and unassigned RuizhiSunMS Jan 17, 2025
@guoms1 guoms1 added Type: product question Question about the Office Add-ins platform or Office JavaScript APIs Needs: author feedback Waiting for author (creator) of Issue to provide more info and removed Needs: attention 👋 Waiting on Microsoft to provide feedback labels Jan 20, 2025
@guoms1
Copy link

guoms1 commented Jan 20, 2025

@15MariamS

Thank you for reaching out and providing details about your issue.

After consulting with our team, I would like to clarify that the Word.Shape API is currently in preview. Because it is in preview status, the documentation is accurate for the current capabilities. Once the preview period ends, the documentation will be updated accordingly.

Thank you for your understanding.

Best regards,

@15MariamS
Copy link
Author

the Word.Shape API is currently in preview.

Is there no other way to get the text from textboxes (or insert new text into them)? Otherwise, how can I use the preview API to do this?

@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 Jan 20, 2025
@ElizabethSamuel-MSFT
Copy link
Contributor

@RuizhiSunMS Can you or someone from the feature crew provide sample code showing how to get text from textboxes with shipped API (if possible) and with the preview API? Thanks.

@guoms1
Copy link

guoms1 commented Jan 24, 2025

Here is the reply I got from the expert:

This is a preview API. As another option, they might be using getOoxml to parse context (but it’ll be a little complex for most users).

Thanks,

@guoms1 guoms1 added Needs: author feedback Waiting for author (creator) of Issue to provide more info and removed Needs: attention 👋 Waiting on Microsoft to provide feedback labels Jan 24, 2025
@15MariamS
Copy link
Author

This is a preview API. As another option, they might be using getOoxml to parse context (but it’ll be a little complex for most users).

Ah, yeah I am parsing the content fine with getOoxml, but want to edit the content in an add-in and apply those changes which is where the Shapes API would be useful. Is there an ETA for when the API would be available?

@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 Jan 25, 2025
@guoms1
Copy link

guoms1 commented Jan 27, 2025

Hi, @15MariamS

Thank you for sharing your use case. Currently, I don’t have an ETA for the Shapes API, but I’ll let you know as soon as I have any updates.

Let me know if you need assistance with your current approach in the meantime.

Best regards,

@guoms1 guoms1 removed the Needs: attention 👋 Waiting on Microsoft to provide feedback label Jan 27, 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 question Question about the Office Add-ins platform or Office JavaScript APIs
Projects
None yet
Development

No branches or pull requests

5 participants