views:

13

answers:

1

Greetings,

I'm working on a preview handler for Office 2007, Vista and Windows 7. I'm basing my code off the following MSDN article.

The "guts" are done as it was pretty straight forward. I've been testing in Windows 7 (64-bit) Explorer. One thing I've noticed is the preview handler appears to "lock" the Explorer window and doesn't allow it to resize.

My handler derives from FileBasedPreviewHandler, the Control from FileBasedPreviewHandlerControl. The #Load override simply does:

MyViewer viewer = new MyViewer();
viewer.Dock = DockStyle.Fill;
viewer.SetFile( file.FullName );
Controls.Add( viewer );

A couple things I've tried, a variety of times is to set, in the design view, the AutoSize and AutoSizeMode to true and GrowAndShrink

Now, the funny thing, i swear it worked once. Now, I can't get it to work at all.

If anyone has any input, that would be great. I think I posted all the relevant info, but if I missed something vital, let me know. I appreciate your attention to this question.

-Cheers!

A: 

Apparently, by setting the AutoSize and AutoSizeMode as state above, does work. Explorer is simply temperamental. What I found was if you get strange behavior, you can use task manager to close the explorer process than relaunch it.

For the record, what I found works 99% of the time is to to:

  1. make sure all Explorer windows areclosed (w/ preview panel off)
  2. unregasm/remove from ga
  3. build
  4. add to gac/regasm
  5. run Explorer and check preview panel
  6. rinse & repeat

I'm also using a throw-away win forms app to test changes that don't involve the integration.

Hope this helps someone looking.

-Cheers!

DevSolo