Hi!
I am developing a template based addin for Word 2003 which allows the user to drag and drop elements from a listbox into the word document. Unfortunately I'm getting a really strange behaviour when trying to drop elements in the document's header.
- Open the template and type something in the header
- Close the header and insert some content on the page
- Add a page break.
- Switch to page layout mode where and set zoom level to "Two Pages"
- Open the header
- Slowly Drag and Drop an list item from the list box to the header.
- See multiple Page Setups dialogs occur which cause Word to crash.
Here is my code:
// in ThisDocument.cs
public MyUserControl _control;
public void Init()
{
_control = new MyUserControl();
ActionsPane.Controls.Add(_control);
ActionsPane.Visible = true;
}
// in MyUserControl.cs
public void listBox1_MouseDown(object sender, MouseEventArgs e)
{
DoDragDrop("something", DragDropEffects.Copy);
}
Have I done somethinkg wrong with implementing Drag and Drop? Is there a workaround for this strange behaviour?
Thanks in advance,
Oliver Hanappi
Video
I've made a little video which shows the bug. You can download it from here: http://rapidshare.com/files/364907873/word-2003-bug.rar
Unfortunately the tool I used didn't notice that I changed the display settings, so although I used 1280x768, it recorded 1920x1200, so sorry for the strange video size. If you cannot watch the video, maybe the codec is missing. You can get it here: http://camstudio.org/
I also forgot to mention that the bug also occurs in Word 2007. Because on my local machine I have only Word 2007, I recorded the video with Word 2007, but it is basically the same for Word 2003 (where I found the bug)