> > and fails with "This is not a valid file name."
>
>Can you log what file name is failing?
>
>Possible reasons for the failure:
>
>- use of virtual folder names like "My Documents"
>- spaces in path (should work, but not always reliable)
>- illegal chars in file name, eg. "<", ">", etc.
>
>My bet is on the first reason due to it working on Windows 2000, but not
>Windows 7.

That particular error occurs in WinXP, not Windows 7.

However, EUREKA!

It's been so long since I worked on this report, I had forgotten that I 
need to distribute an external .bmp image file to make it work. Once I had 
that file in the home directory on WinXP, it worked fine.

However, the problem remains in Windows 7. And in that environment, we 
don't ever get to the oDocShapes.AddPicture( [bunch of parms] ) line.

As described in previous emails, the failure occurs on:

documents.Add

or

documents.Add()

or

documents.Add(SomeValidWriteablePath\SomeFile)

whether or not the document has been previously created and closed or left 
open. The code that works in WinXP is:

* In Windows 7 this resolves to "C:\Users\kend\Desktop\Test.doc"
cPathFile = "C:\Documents and Settings\kend\Desktop\Test.doc"

nHandle = FCREATE(cPathFile)

oWord = CREATEOBJECT("Word.Application")

WITH oWord
      .documents.Add  && Works in XP, fails in 7 with "Could not open macro 
storage"
      .
      .
      etc.
ENDWITH

As I've described, at that point in Windows 7, Word has created a 1 kb temp 
~$Normal.dot file in the same location as Normal.dot, which, in Windows 7, 
is C:\Users\kend\My Documents\Office Templates\"--a legally writeable 
location. And the Normal.dot template works fine in that location when 
using Word manually in Win 7.

So Normal.dot is not corrupt, and I'm writing only to legally writeable 
locations in Win 7, and I'm running as an Administrator, and I have 
explicitly assigned every possible permission to the Office applications 
tree in the Registry. So I don't see how there can be a permissions issue 
in Windows 7.

Any other thoughts?

Thanks very much.

Ken Dibble
www.stic-cil.org


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to