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

context.application.createDocument works only first time #4771

Closed
ishanig11 opened this issue Aug 9, 2024 · 9 comments
Closed

context.application.createDocument works only first time #4771

ishanig11 opened this issue Aug 9, 2024 · 9 comments
Assignees
Labels
Area: Word Issue related to Word add-ins Needs: author feedback Waiting for author (creator) of Issue to provide more info Status: no recent activity Issue or PR is stale (no recent activity)

Comments

@ishanig11
Copy link

ishanig11 commented Aug 9, 2024

I am using below code to open document in new tab. This code is working fine for first time. After that its opening document in tab which is previously opened. Can you check code and let me know what change I need to make to handle this issue?

export const openDocument = async (file) => {
await Word.run(async (context) => {
const response = await toBase64(file);
var externalDoc = context.application.createDocument(response);
externalDoc.open();
await context.sync();
const builtInProperties = context.document.properties.customProperties;
builtInProperties.load("*");
await context.sync();
});
};

@microsoft-github-policy-service microsoft-github-policy-service bot added the Area: Word Issue related to Word add-ins label Aug 9, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: attention 👋 Waiting on Microsoft to provide feedback label Aug 9, 2024
@shanshanzheng-dev
Copy link

Hi @ishanig11 Thanks for reporting this issue, I try this code to create document on word online, it works fine for each time. You can try this code: https://gist.github.com/shanshanzheng-dev/bf71a24597898b4f0cf4d52ab90306be

@shanshanzheng-dev shanshanzheng-dev 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 Aug 12, 2024
@ishanig11
Copy link
Author

what is difference compared to my code which I wrote in react. I see un block is similar to what I used.

@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 Aug 12, 2024
@shanshanzheng-dev
Copy link

Hi @ishanig11, sorry, you use the code that I provided still hit a block? Could you share us your test document, the whole test code or repro video? Thanks. I'm not sure if I miss something, because I can create a new document every time when run this API. You can see this video:

Screen.Recording.2024-08-13.at.04.51.48.mov

@shanshanzheng-dev shanshanzheng-dev added the Needs: author feedback Waiting for author (creator) of Issue to provide more info label Aug 13, 2024
@ishanig11
Copy link
Author

Please try this in online version. No issue with desktop.

@microsoft-github-policy-service microsoft-github-policy-service bot removed the Needs: author feedback Waiting for author (creator) of Issue to provide more info label Aug 13, 2024
@shanshanzheng-dev
Copy link

Yes, my video is word online.

@shanshanzheng-dev shanshanzheng-dev added the Needs: author feedback Waiting for author (creator) of Issue to provide more info label Aug 14, 2024
@ishanig11
Copy link
Author

If you see everytime tab is opening but its replacing document6 with document7 and so on.. we dont see them under new tabs.

@microsoft-github-policy-service microsoft-github-policy-service bot removed the Needs: author feedback Waiting for author (creator) of Issue to provide more info label Aug 16, 2024
@shanshanzheng-dev
Copy link

Hi @ishanig11 currently, this is our by-design behavior. But you can submit a new Tech Community New Ideas item, this will give us visibility of the commonality of it and will help with our prioritization. If we end up working on this issue, we will re-activate as needed.    Microsoft 365 Developer Platform - Microsoft Community Hub

@shanshanzheng-dev shanshanzheng-dev 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 Aug 16, 2024
Copy link
Contributor

This issue has been automatically marked as stale because it is marked as needing author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. Thank you for your interest in Office Add-ins!

@microsoft-github-policy-service microsoft-github-policy-service bot added the Status: no recent activity Issue or PR is stale (no recent activity) label Aug 20, 2024
Copy link
Contributor

This issue has been closed due to inactivity. Please comment if you still need assistance and we'll re-open the issue.

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 Needs: author feedback Waiting for author (creator) of Issue to provide more info Status: no recent activity Issue or PR is stale (no recent activity)
Projects
None yet
Development

No branches or pull requests

2 participants