By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,686 Members | 1,558 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,686 IT Pros & Developers. It's quick & easy.

Getting InkOverlay and WinWord playing together nicely

P: 1
I am trying to add an annotations overlay to MS Word (using the InkOverlay class provided by the Microsoft.Ink namespace) in VB.NET. To bind the InkOverlay to Word (or antyhing for that matter), it accepts a handle (InkOverlay.Handle) of the window.

I have tried using the PIAs for office to start Word (word.application), but can't find a way to get the window handle from it to attach to the InkOverlay object. Lately I have been using the System.Diagnostics.Process to start "WinWord" and retrieve the MainWindowHandle from it, but I get the error that the process has exited already (see code below).

Expand|Select|Wrap|Line Numbers
  1.  
  2. Dim P as New Process
  3.  
  4. With P.StartInfo
  5.             .FileName = "C:\Program Files\Microsoft Office\OFFICE11\WINWORD.EXE"
  6.             .WindowStyle = ProcessWindowStyle.Maximized
  7.             .UseShellExecute = False
  8.         End With
  9.  
  10.         P.Start()
  11.         WinHandle = P.MainWindowHandle
  12.  
  13.  
I am looking for any assistance you can provide.

-Matt Ray
Jul 5 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.