Miguel Peixoto

Hi!

Hope someone can help with this...

I'm currently working with VSTO SE and Office 2007 and i'm trying to figure out how to drag&drop GridView content into an Word document.

The GridView is in a custom task pane. Inserting a row's data by doubleclick, for example, is easy but i really couldn't find any help with this drag&drop thing...

Thanks!




Re: Visual Studio Tools for Office Drag&Drop GridView content

Cindy Meister

Hi Miguel

Word doesn't expose any drag-and-drop functionality to the programmer. Search the terms -- drag drop Word -- in the forum and you'll get some discussion on the point, with approaches that have been tried and their success. Perhaps you can use some of them to get what you're looking for.






Re: Visual Studio Tools for Office Drag&Drop GridView content

X4U

Hello Miguel,

as I understand you have a DataGridView and want to drag a GridViewContent and drop it into word.

The drop functionality is already there in Word so you only have to implement code for the DataGridView.

Therefore you have to intercept the MouseDown event

Here is a sample

http://www.codeproject.com/csharp/DataGridView_Drag-n-Drop.asp

Hope this helps,

greets, Helmut