Prev: EditUndo not fired in Word 2007
Next: Difference range between ContentControlRichText & ContentControlGr
From: dymutaos on 25 Jan 2010 14:18 Bug Report (can't find out how to submit bug reports other than here) Summary of bug - Word 2007 automation object throws error 5174 with any filename that has the pound sign (#). I have run into this bug only when using the Automation object for Microsoft Word 2007. I have not tried this with other versions of Word. The file I am opening is a "doc" file, NOT a "docx" or "docm". The filename contains a pound sign (#). I am able to open this file using any other method (File->Open; double-clicking from Windows Explorer; etc). But when opening using a Word.Application object with the Documents.Open method, the script throws the Error 5174, which is a File Not Found error. I am able to open any other file with this same code, and only by removing the pound sign am I able to open this file with the script. Error 5174 (File Not Found) is stating that Word cannot find the file. Because the file exists, and because Word is able to open the file using other means, this error is being incorrectly generated. Please fix the bug so that the Word automation object can handle files with the pound sign correctly. Or, if the object cannot handle files with pound signs in their filename, please create a new error message pertaining to the real issue. Thank you. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http://www.microsoft.com/office/community/en-us/default.mspx?mid=e2437b12-335f-4906-a9fe-bd15342f2e51&dg=microsoft.public.word.vba.general
From: Fumei2 via OfficeKB.com on 26 Jan 2010 15:26
"Please fix the bug so that the Word automation object can handle files with the pound sign correctly. Or, if the object cannot handle files with pound signs in their filename, please create a new error message pertaining to the real issue." Do you think you are writing to Microsoft here? Sorry, but that is not the case. BTW: Set wdApp = CreateObject("Word.application") Set wdDoc = wdApp.Documents.Open(Filename:="c:\zzz\Tues#day.doc") wdApp.Visible = True wdDoc.Close Set wdDoc = Nothing wdApp.Quit Set wdApp = Nothing works fine in Word 2002. It opens a file with # in it. This must be - surprise - a 2007 issue. dymutaos wrote: >Bug Report (can't find out how to submit bug reports other than here) >Summary of bug - Word 2007 automation object throws error 5174 with any >filename that has the pound sign (#). > >I have run into this bug only when using the Automation object for Microsoft >Word 2007. I have not tried this with other versions of Word. > >The file I am opening is a "doc" file, NOT a "docx" or "docm". The filename >contains a pound sign (#). I am able to open this file using any other method >(File->Open; double-clicking from Windows Explorer; etc). But when opening >using a Word.Application object with the Documents.Open method, the script >throws the Error 5174, which is a File Not Found error. I am able to open any >other file with this same code, and only by removing the pound sign am I able >to open this file with the script. > >Error 5174 (File Not Found) is stating that Word cannot find the file. >Because the file exists, and because Word is able to open the file using >other means, this error is being incorrectly generated. > >Please fix the bug so that the Word automation object can handle files with >the pound sign correctly. Or, if the object cannot handle files with pound >signs in their filename, please create a new error message pertaining to the >real issue. > >Thank you. -- Message posted via http://www.officekb.com |