HighTechTalks DotNet Forums  

Opening a word document in rich textbox control in VB.Net

Dotnet Framework (Interop) microsoft.public.dotnet.framework.interop


Discuss Opening a word document in rich textbox control in VB.Net in the Dotnet Framework (Interop) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
=?Utf-8?B?R0FVVEFNIEtBU0hZQVA=?=
 
Posts: n/a

Default Opening a word document in rich textbox control in VB.Net - 06-27-2007 , 05:26 AM






Hi

I am working on a windows application develoed using .Net framework 1.1 in
VB.Net.I have a requirement where I need to open a word document in a rich
textbox control. I open a new word document ( WordApp = New
Word.ApplicationClass)
and extract the handle of this document (hWndChild = <Word
Process>.MainWindowHandle.ToInt32()). Then I extract the handle of rich
textbox ( hWndParent = <RichTextBox>.Handle.ToInt32()) and use the SetParent
method to establish a parent child relationship between the two.

The code I am using is as under

SetParent(hWndChild, hWndParent)

<DllImport("user32.dll", EntryPoint:="SetParent", _
SetLastError:=True, CharSet:=CharSet.Unicode, _
ExactSpelling:=True, _
CallingConvention:=CallingConvention.StdCall)> _

Public Shared Function SetParent(ByVal hWndChid As Int32, ByVal hWndParent
As Int32) As Int32
End Function

My problem is when the word window opens is the rich textbox it is
minimized. I want to open the window in maximized state. I have tried
<WordApp.Documents.Open(<Path>)>.Windows.Applicati on.WindowState = 1 but this
does not seem to work.
Also I want that the word window should not be closed or minimized
explicitly so I want to hide the tite bar of word window. Please help me in
resolving these issues.

Regards
GAUTAM KASHYAP

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.