How to drag content of document from task pane to word - drag-and-drop

I have created a word add-in. In the add-in there is a list of documents available. I just want to implement drag and drop functionality in the add-in. like when user drag the document from task pane to word then content of document should be display in the word.
I have checked the documents online but there is nothing about this functionality.
Is drag and drop is possible in the word add-in?

For directly realizing the drag and drop event, I think we don't provide such an API to detect the drop event in doc. But as a workaround, maybe we can implement a "+" button to insert the content to the selection.
For inserting the content in document, we have such JS API called Body.insertFileFromBase64()

Related

Alter rendered view of TinyMCE

I've built some kind of spellchecker application in TinyMCE. Basically, when the user clicks a button on the toolbar, a call is made to an API and the results are processed in a custom JavaScript function. This custom function replaces the contents of the editor with <span>s around the keywords that were returned from the API. The keywords are then underlined, much like the spellcheck functionality in Word/Google Docs/Chrome/etc. So far so good, and everything is working. What I want to achieve is that the user doesn't 'see' my inserted <span>s, so I only want to alter the 'view' part of TinyMCE, not the contents itself. Is this even possible?

Taking a Word document out of design mode

This should be a really simple thing that for some reason I can get to work.
I have an MS Word document which has a drop-down field. If I double-click it - a dialog comes up to add or remove things from the drop-down field.
I just need to be able to get out of this mode so that the drop-down field behaves like it should from a user's point-of-view rather than from a design point-of-view. Basically I just need it to display the items rather than a dialog to allow me to add and remove the items.
According to what I've read, it looks like I should be able to do this by going to Developer, and then toggling the Design Mode button. This doesn't work; whether the Design Mode button is on or off I still can't get it to just act like a drop-down.
Thanks much
It sounds like you're using a legacy form field dropdown. For those to operate as a dropdown, you must protect the document for forms:
On the Developer tab, click on Restrict Editing. The Restrict Editing task pane opens.
In the task pane, check the box beside Allow only this type of editing in the document.
In the next dropdown, choose Filling in forms.
Click on Yes, Start Enforcing Protection.
Protected forms don't allow text to be edited in protected sections. In those areas, only form fields allow you to enter text. If that's too restrictive, look into Content Controls, which don't require document protection.

Word add in: how to activate task pane by click on hyperlink in document

I develop a word add in using the javascript Word API. I would like to know how I can show some content in the task pane when the user clicks a hyperlink in the document. Is that possible from hyperlinks or perhaps by some other means?
1) User click hyperlink in document
2) I capture that event (by some unknown means) and something happens in the taskpane, e.g. write the text "you clicked my friend" in the taskpane

In vscode how do you tell if or where a document provided by a TextDocumentContentProvider is shown

I am working on an extension in vscode that uses a TextDocumentContentProvider to provide users with feedback on the effects of changes they make to the file they are editing.
A common use case is for the user to drag the virtual document to a separate pane so they get a side by side view of the live document and the virtual document.
To display the virtual document, I need to call showTextDocument(), however this opens it in the current pane, giving two copies of the same document, and also makes it the current tab, hiding the document the user is working on.
I do not seem to get open or close events for virtual docs - which would mean I could just not call showTextDocument(), and I cannot find any API that allows me to find out or set which pane a document is open in.
WebViews are a special document type. You neither can enumerate open tabs for them nor can you influence the exact tab position, except for the view column. OK, the same about the tab position can be said for normal text documents.

show information about connection state on status bar

VSTO document-level customization, using C#
I need to show permanent information about the connection state in a word document.
I had the idea to do it from the status bar but I don’t know how modify it.
The current object models for Word do not provide access to its Status Bar. The Word Status Bar provides a lot of information about the Word application, as well as controls for interacting with it and what it contains can be customized by the user. So there's no way provided for the Developer to access it, no should the Developer interfere with such an important part of the User UI.
EDIT: Since this is a VSTO document, it would be possible for you to display this information in the Actions Pane (task pane for the document). It would also be possible to display it in the Ribbon or possibly in the Title bar. The tricky part about this last is that the title bar will change/update as you'd be "sharing" it with the Word application. But the capability is built into the Word application, via its Window object. For example:
theDocument.Application.ActiveWindow.Caption = "custom text"
The text assiged to the Caption property will replace the document name and be positioned just before the text "Microsoft Word". If you want to retain the document name in the Title bar you'd need to query and append that to the string you assign to Caption.