Microsoft Office Automation — Gottcha!

I have been doing a Documentum upgrade (D6.0-D6.7) and migration (Windows 2000 – Windows 2008) for a client the past few weeks.  Their system is moderately complicated and has a lot of moving parts.  One of the simpler parts is a custom Webtop action that checks out a Microsoft Word document and calls a VB script to launch Word to save the document as text.  After some other munging, the action imports the text file to a different location in the Docbase.  This is a really simple action, and has worked for years on this client’s Documentum infrastructure.  Now, on the new D6.7/Windows 2008 infrastructure the action fails.

I was able to track the problem to Microsoft Word not being able to open the file that the VB script passed to it.  The error I received was something like this:

This command is not available because no document is open (Err 4248).

When I ran the VB script manually it worked fine, so I concluded that it must be a permission issue.  No, the VB script was run as the Local System user.  Perhaps it didn’t like spaces in the path name, so I moved the checkout location to c:\temp.  No, same error.  Perhaps VB script is different in Windows 2008, so I regenerated it using the Record Macro feature of Word.  Nope, same problem.

Finally, I found the answer — almost on accident — here.  The problem is that the automation script runs as the Local System user, which does not have a full user profile in Windows 2008.  Windows 2000 was a little more lenient about these things and let you get away with it; no longer in Windows 2008.

The solution?  It was simple, create a Desktop folder for the Local System user.

  • On 32-bit platforms, create the folder C:\Windows\System32\config\systemprofile\Desktop
  • On 64-bit platforms, create the folder C:\Windows\SysWOW64\config\systemprofile\Desktop
Advertisements

About Scott
I have been implementing Documentum solutions since 1997. In 2005, I published a book about developing Documentum solutions for the Documentum Desktop Client (ISBN 0595339689). In 2010, I began this blog as a record of interesting and (hopefully) helpful bits of information related to Documentum, and as a creative outlet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: