Drag and Drop in Office JS page to Word Document - ms-word

I am creating an online office add-in for the Word application. I have created an HTML page with some fields like, Name, Address, Mobile etc.
On drag and drop of such a field I want to create a MergeField in Word Document.
I have done R&D regarding drag and drop but I am not able to find how to control a drop event outside of the container.
Is there any way to fulfill my requirement?

Due to browser limitations we don’t currently support drag and drop from the taskpane to the word surface.
But what many developers have implemented is a ‘+’ button to add items into the document, or other sorts of events like dbl click.

Related

MS Word add-in Content Controls with button-like trigger for Dialog

I am developing an MS Word add-in using word JavaScript API. My use case is that I allow the user insert table, but the table is wrapped with Content Control with the cannotEdit flag set to true. So the table inside the document is only read-only and editing happens only through a separate dialog, that is supposed to be opened by clicking a button below the table.
After digging through the documentation I couldn't find any relevant info regarding inserting buttons into the document. What is my best bet then, what could be the workaround? Could OOXML help here somehow?

Dynamic data manipulation in word online

I am trying to build a task-pane add-in for word online which can do mail merge like desktop office. Now I understand that word online does not support mail merge out of the box, so I thought about the following steps -
Create a template (DOTX) using desktop office which will contain Region or something like a merge field etc. Upload the template to one drive.
Open a blank doc and add a task pane add-in in word online. This is temporary step for now.
Click a button on the add-in.
This click will stream the template (DOTX) from server using an app service call.
Render the stream into word online web page.
Edit and save.
Close word online and reopen.
Click the doc link.
This will render the doc in word online.
Add the add-in in the task pane (temp step).
Click edit button.
Call app service to fetch the latest merge data source.
Traverse through the word xml and replace the values corresponding to the region or special keys.
Re-render the doc.
My users will have E1 subscription of office 365.
Is this thought process logical and achievable with word online? Thanks in advance!...
I think your approach is much more complicated than it needs to be. Word Online supports Add-ins created using the JavaScript APIs, as supported by the information in this article: https://msdn.microsoft.com/EN-US/library/office/dn833104.aspx
It should be possible for you to create the "template" on the Desktop (Word 2013 or 2016 is required - but only 2016 supports the current full scope of the JS API) and "insert" your add-in, which links it to the document. Opening the document in Word online should automatically load the add-in, that can then link to the data source and fill in the data.
As data targets ("merge fields"), I recommend you use Content Controls.

Change fields depending on drop down selection in Microsoft Word design mode

Can anyone point me to info about how to create a Microsoft Word document that changes text input fields depending on what the user selects in a drop-down menu?
I'm using Word, Developer toolbar, Design mode, and have gotten as far as how to create the drop down selection box, and add text input fields below that on the page, but I need to know how to change what fields appear depending on what the selection is. I'm sure it's possible, I just don't know how to go about it.
I'm pretty good with this sort of thing in HTML with javascript and jQuery, but Word is its own little world.
I tried the "structured" tab but it suggests selecting XML add ins, and none appear in the list to select.
One option is using a template approach in combination with 3rd party toolkit and external application. External application takes care for user interface where user selects template and sets filter for data retrieval. The application then reads the data, generates new document based on template and populates it with data.
You don’t have to mess with MS Word macros and this solution can survive Office upgrades very smoothly.
Template design in done in MS Word. We are using third party toolkit (i.e. Docentric Toolkit) for populating Word documents with data.

VSTO Word AddIn 2007/2010 Disable Editing, like document management systems do

Could you tell me please how it is possible to:
somehow disable editing an open document?
or get notified when the user is about to change the current document?
like some document management apps do: while the document is checked in they:
do not allow modifications to it or
when user tries to modify it he will be notified that the document is checked in so it should be checked out first
Set the document protection type to WdProtectionType.wdAllowOnlyReading which is similar to opening word document from Email, Internet or SharePoint portal.
When the use click the Edit anyway yellow bar in the top ProtectedViewWindowDeactivate Event will occur where you can raise an alert.

How to prevent a user from Editing Word document loaded in DsoFramer using C#4.0?

We are developing C#.net 4.0 Windows Forms based application.we are using Dsoframer control to embed the Word document into my Application.Here, i want to prevent the user to edit the document.I have already opened Word Document in READ Only Mode.But still user can able to edit the doucment.Anyway, the updated content is not refelected in the original Document.But i would also like to prevent the user to make such editing?
wordDoc.Protect(Microsoft.Office.Interop.Word.WdProtectionType.wdAllowOnlyReading);
This is do that...