_GetMSWordtext proc hWordEdit:DWORD

;invoke GetCursorPos,addr @point
;invoke WindowFromPoint,@point.x,@point.y  ;
;mov hwnd,eax

invoke RtlZeroMemory,addr szbuffer,sizeof szbuffer
invoke SendMessage,hWordEdit,WM_GETTEXT,4096,addr szbuffer
invoke Messagebox,NULL,addr szbuffer,NULL,NULL
_GetMSWordtext endp

the above code gets nothing from MS word.
so how do i?
Posted on 2010-02-20 23:57:09 by dcskm4200
The most convinient way to retrieve the text of a word document is to establish a COM communication with the Word application. There are  many examples in the net on how to do it, one of them can also be found in the ObjAsm32 package here "ObjAsm32\Projects\Office\WordHost". A little warning, using COM is not for everyone, since it is more complex than using simple APIs and you need a full understanding of how the interfacing works.


Posted on 2010-02-21 04:27:39 by Biterider
thanks your wordhost.
it's too understand for me.
about COM, following codes is easy to understand.


QueryInterface comethod3 ?
AddRef comethod1 ?
Release comethod1 ?
SetNotifySink comethod2 ?
SetNotifyWindowMessage comethod5 ?
SetNotifyCallbackFunction comethod4 ?
SetNotifyCallbackInterface comethod4 ?
SetNotifyWin32Event comethod1 ?
WaitForNotifyEvent comethod1 ?
GetNotifyEventHandle comethod1 ?
SetInterest comethod3 ?
GetEvents comethod4 ?

GetInfo comethod2 ?
SetOutput comethod3 ?
GetOutputObjectToken comethod2 ?
GetOutputStream comethod2 ?
xPause comethod1 ?
Resume comethod1 ?
SetVoice comethod2 ?
GetVoice comethod2 ?
Speak comethod4 ?
SpeakStream comethod4 ?
GetStatus comethod3 ?
Skip comethod4 ?
SetPriority comethod2 ?
GetPriority comethod2 ?
SetAlertBoundary comethod2 ?

GetAlertBoundary comethod2 ?
SetRate comethod2 ?
GetRate comethod2 ?
SetVolume comethod2 ?
GetVolume comethod2 ?
WaitUntilDone comethod2 ?
SetSyncSpeakTimeout comethod2 ?
GetSyncSpeakTimeout comethod2 ?
SpeakCompleteEvent comethod1 ?

IsUISupported comethod5 ?
DisplayUI comethod6 ?

ppVoice DWORD ?

CLSID_SpVoice GUID <96749377H,3391H,11D2H,<9EH,0E3H,00H,0C0H,4FH,79H,73H,96H>>
IID_ISpVoice GUID <6C44DF74H,72B9H,4992H,<0A1H,0ECH,0EFH,99H,6EH,04H,22H,0D4H>>

invoke CoInitialize,NULL
invoke CoCreateInstance,addr CLSID_SpVoice,NULL,CLSCTX_ALL,addr IID_ISpVoice,addr ppVoice

mov eax,ppVoice
mov edx,
invoke (ISpVoice PTR).SetVoice,ppVoice,NULL

Posted on 2010-02-21 19:11:43 by dcskm4200
My guess is that you understood well :) Good stuff !!
Posted on 2010-02-22 00:12:35 by Homer