Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Many a times we may need to drag drop business objects from custom pane(Addin/document level project) or Hosted application to Word surface.
Consider a Tree Control having multiple nodes and different kinds of business objects. These business objects may need different kind the automation tasks when dropped at a particular ___location inside word surface. These drops also may need to validate ___location of the drop and allow or disallow the same.
There is no direct way to have this feature. We must apply a workaround to achieve the same. I will try to explain how we could do this for a WPF/Windows application hosting Word internally. Below are the steps :
Create a WPF/Windows application to host Word application.
Reference the all the PIA's in the custom app.
Create a Editor class and attach selection change event to a delegate.
Create a static class to hold the global drag drop state and object.
-
Implement the selection change event as shown below
-
Implementing process drop
-
Assign the GlobalDragDropElement in before drag event of the control in the WPF/Windows app to set the drop object and selection text. The selection text is would be the unique identifier and can be a GUID.