R
RealCat
I'm accessing MS Word using .NET interop. I posted a question at the
C# news group but I got no reply. (My original post was
http://groups.google.com/group/micr...p/browse_thread/thread/b509664c6a3a5043?hl=en)
Maybe I posted it to a wrong group.
I have read VBA documentation but the description was enough,and there
was no sample code, and the funtion names were so general that I
cannot find results from Google.
Isn't Document.Scripts.Add() for adding script (functions or subs)
dynamically? I added a simple sub (with just one msgbox statement),
then tried to run it with Word.Application.Run(), but an exception
occurred saying "Unable to run the macro." If you know any hints,
please let me know. Thank you.
PS : Basically what I'm trying to do is:
script = LoadMacroFromVBSFile(file name)
For each doc in many .doc documents
{
apply the script to the doc
}
C# news group but I got no reply. (My original post was
http://groups.google.com/group/micr...p/browse_thread/thread/b509664c6a3a5043?hl=en)
Maybe I posted it to a wrong group.
I have read VBA documentation but the description was enough,and there
was no sample code, and the funtion names were so general that I
cannot find results from Google.
Isn't Document.Scripts.Add() for adding script (functions or subs)
dynamically? I added a simple sub (with just one msgbox statement),
then tried to run it with Word.Application.Run(), but an exception
occurred saying "Unable to run the macro." If you know any hints,
please let me know. Thank you.
PS : Basically what I'm trying to do is:
script = LoadMacroFromVBSFile(file name)
For each doc in many .doc documents
{
apply the script to the doc
}