We are producing barcode labels thrue mailmerge. In our development environment all works fine, and it is running smoothly as a service-NAS.
In the production enviroment the solution refuses to work. All goes well untill the saved merge XML file is openend with word :
cuAppManagement.LaunchApp(xmlData,guidStyleSheet,xmlApp);
xmlApp.save(strFileNameResult);
CREATE(objWord,FALSE); // start Word
//objWord.Visible(TRUE); // Winword visible
//objWord.Activate; // Winword active
objWord.Documents.Open(strFileNameResult);
In the eventlog we get the following message:
The call to member ActiveDocument failed. Microsoft Word returned the following message:
Deze opdracht is niet beschikbaar omdat er geen document is geopend.
(The command is not availeble because the document is not openend)
the message resource is present but the message is not found in the string/message table
The solution works fine running on a client. It has previously been working on the NAS when it was started from the command prompt but isn't working anymore??. The NAS-user is a local admin. We tried a timer solution between save and open...
The only differences we can imagine are the servers (development Server2003, production Server2008)
Anyone any suggestions?
Benno
Answers
You could check several links for kind of work-a-round:
http://social.msdn.microsoft.com/Forums/en/innovateonoffice/thread/b81a3c4e-62db-488b-af06-44421818ef91
http://social.technet.microsoft.com/Forums/en-US/office2007deploymentcompatibility/thread/334c9f30-4e27-4904-9e71-abfc65975e23?prof=required
http://social.msdn.microsoft.com/Forums/pl-PL/netfx64bit/thread/338bb030-98d6-4b97-a182-562d985395d9
Follow my blog at http://x-dynamics.blogspot.com
Thanks, could indead be the problem. On the other hand, these are very common solutions within Dynamics NAV, we use Office automation in many solutions (Outlook, Excel), without problems. Everybody does, and I can't immagine I am the first to encounter this problem. The entire Dynamics NAV mailmerge solution is based on Office use, so.
On the other hand it is true, this is the only time that we fist create a file, write it to disk, and reopen it with Word to do some barcode font translation.
I am gone look for a workarround.
Benno
Problem solved . One of your posts did give the right solution :
http://social.msdn.microsoft.com/Forums ... f=required
The problem is that a server-site process that tries to open an Office document, needs a folder to write it's temporary file to.
In the case of 2008 x86 it is : C:\Windows\System32\config\systemprofile\Desktop
After adding the folder, the problem is solved.
Thanks
Benno
It will help other people to get right solution.
Thnx!
Follow my blog at http://x-dynamics.blogspot.com