okay. i made a mod for word..... but when i inject it into work my mod dont run. just for a test i made a msgbox dll. it dont run when i inject it! how do i make it run a function when i inject the .dll? tyvm for your time :wave:
Printable View
okay. i made a mod for word..... but when i inject it into work my mod dont run. just for a test i made a msgbox dll. it dont run when i inject it! how do i make it run a function when i inject the .dll? tyvm for your time :wave:
Have u added the reference to ur DLL ?
Why using DLL?
reference is what now? uhhh lol. i guess i need more research. i am using dll cuz i like the extension :P could any1 explain what a dll referecne is to me?
Goto Project > References. Then browse for ur dll file to add a reference of it in ur project.
EDIT: Sorry, that was in VB. It is in Tools > References... IN WORD
no. you have it backwards. i want it so when i INJECT INTO RUNNING PROCESS it automatically carries out a function. ty for your effort tho.
You can't inject a VB dll into a running process.
VB uses apartment threading, and you can't inject it safely into a free threaded process.
so your basically saying my hard work goes to waste?
you can carry out operations in word by referencing word and creating an instance of word, you can then do anything a user can do whilst in word
pete
DLL injection is not the way to go.
This doesn't mean that you cannot use your dll form word.
From teh Word VBA window, go to Tools --> References, and check your dll.
If it isn't in the list, you can browse to it.
Next you can use it like any other object.
eg. If your project is named myProject, and it contains a class with the name MyClass, you can use it like this:
VB Code:
Dim x as MyProject.MyClass Set x = New MyProject.MyClass 'Set x = CreateObject("MyProject.MyClass") ' the above line can be replaced with this one Call x.somemethod Set x = Nothing