Hello Everybody,
I'm trying to automate the process of printing a Word document from command line... obiouvsly everything works fine on MY machine... but as soon as I move to another machine, the application hangs and gives me an error.
Here's the code:
[...]
Dim msWord As Word.Application
Set msWord = GetObject(Class:="Word.Application.8"
strSourceFileNameComplete = "C:\test.doc"
msWord.Visible = False
msWord.ActivePrinter = "Acrobat Distiller"
'so far everything works fine...
'but next line doesn't get executed
msWord.Documents.Open strSourceFileNameComplete
[...]
I can actually see Word starting... but as soon as I try to open a specific file, it hangs.
Again, on my machine works fine... but on any other machine it hangs. I also tried to install Visual Studio on the target machine, recompile it (adding the reference to Word10 obj lib), uninstall Visual Studio and run the application: it works.
What am I missing??
Thanks a lot for your responses!
Cheers,
--marco
I'm trying to automate the process of printing a Word document from command line... obiouvsly everything works fine on MY machine... but as soon as I move to another machine, the application hangs and gives me an error.
Here's the code:
[...]
Dim msWord As Word.Application
Set msWord = GetObject(Class:="Word.Application.8"
strSourceFileNameComplete = "C:\test.doc"
msWord.Visible = False
msWord.ActivePrinter = "Acrobat Distiller"
'so far everything works fine...
'but next line doesn't get executed
msWord.Documents.Open strSourceFileNameComplete
[...]
I can actually see Word starting... but as soon as I try to open a specific file, it hangs.
Again, on my machine works fine... but on any other machine it hangs. I also tried to install Visual Studio on the target machine, recompile it (adding the reference to Word10 obj lib), uninstall Visual Studio and run the application: it works.
What am I missing??
Thanks a lot for your responses!
Cheers,
--marco