HiHI,
my app is running on the background, and I want get the active window(If
it is word) 's word document's filepath. I search the Internet and can't
find well way.
1. I find the old thread,but i knew few about COM, that is to difficault
to me, that is:
http://groups.google.com/groups?hl=z...&threadm=O5eg%
2446RDHA.2248%40TK2MSFTNGP11.phx.gbl&rnum=1&prev=/groups%3Fq%3Dword%2Bget%2B
file%2Bpath%2Bgroup:microsoft.public.dotnet.langua ges.csharp%26hl%3Dzh-CN%26
lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26group%3Dmicrosoft.public.dotnet.languages.
csharp%26selm%3DO5eg%252446RDHA.2248%2540TK2MSFTNG P11.phx.gbl%26rnum%3D1
2. a vb sample , but can't the the function GetObject In C#
Dim otmpword As Object 'Word.Application
Set otmpword = Nothing
Set otmpword = GetObject(, "Word.Application")
If not otmpword Is Nothing Then
msgbox otmpword.ActiveDocument.path
end if
then anybody can give me a clear sample in C#? thank you very much!!!!
--Shi