Word Automation - throws error 5174 opening file with '#' in filen

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
0
Utf
1/25/2010 7:18:01 PM
word.vba.general 1023 articles. 1 followers. Follow

1 Replies
1604 Views

Similar Articles

[PageSpeed] 28

"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

0
Fumei2
1/26/2010 8:26:59 PM
Reply:

Similar Artilces:

MS Money 95 data files
I hope that some one can answer this for me. I have used MS Money 95 for years, and it works just fine for me on Windows XP, however, I now have to reformat my hard drive, and have discovered that I can nolonger find my original install disk. Will the latest versions of Money still read the MS Money 95 data files. All that I have ever used the program for is to track my investments, and am unlikely to do any different in the future. Thanks Stan B In microsoft.public.money, Stan Banner wrote: >I hope that some one can answer this for me. >I have used MS Money 95 for years, and...

XCH Error 3092, OAB replication
I am getting error 3092 for OAB in Exchnage 2003 (migrated from 5.5) "Error 1129 occurred while processing a replication event. Folder: (3-8) NON_IPM_SUBTREE\OFFLINE ADDRESS BOOK\EX:/o" Tried to delete offilne addressbook and recreate but error has not stopped. Any help will be a great help on where to look to get rid of this issue. Thanks ...

Error Generating the Offlice Address Book
I have a mixed site with 3 5.5 server and 4 2003 servers. I installed 2003 SP1 a few weeks back and since then I'm having an issue generating my Offline Address Book. Here the event log messages I'm getting. Event ID 9331: OALGen encountered error 80040107 (internal ID 501023d) accessing the public folder store while generating the offline address list for address list '/'. - Default Offline Address List For more information, click http://www.microsoft.com/contentredirect.asp. Event ID 9335: OALGen encountered error 80040107 while cleaning the offline address list public ...

Input Excel 'Password to Open' through control in access form
Hi All, We know,Excel has prompt password to open it files. Is it possible to create a code that can supplies the excel prompt password?.So that when we open the excel file through our access control in a form, the excel files can be opened automatically.But when the excel files opened from its default icon,it will prompt a password first. ...

Error: Invalid byte was found at byte index 63.
Does anyone know what this means: "Invalid byte was found at byte index 63. " If yes, please help. Apogee Apogee wrote: > Does anyone know what this means: > > "Invalid byte was found at byte index 63. " That means exactly what it says: At index 63 XML parser found a byte, which is invalid either according document's encoding or is forbidden in XML documents at all (see list of allowed in XML characters at http://www.w3.org/TR/2000/REC-xml-20001006#charsets) -- Oleg Tkachenko http://www.tkachenko.com/blog Multiconn Technologies, Israel ...

Grammar check not working
Hello, I am using Word 2007 and have a problem with grammar and punctuation errors. I deliberately put two spaces between words, do not put space after a comma, write long sentences and finish a sentence without a verb but the green underline never appears. The spell check is functioning properly, no problem with that. In Word Options > Proofing, "Mark grammar errors as you type" is selected. I changed that selection and tried again but it still did not work. I used different languages as default language but no change. I would be grateful if someone could come...

Drag and Drop file/directory names on Tree Control.
hi, I am writing an application in which i have one Tree control. Now i want that , when user drag & drop any file/folder on tree control the file name/folder name should be add in the tree control item. User may drag and drop file from desktop or may be from directory. I just want the path of that file/foder name nothing else. so plz tell me will it be possible ... Plz Help me............. Klic..... > I am writing an application in which i have one Tree control. >Now i want that , when user drag & drop any file/folder on tree >control the file nam...

How can I change 'Normal' Style for Word e-mails to 'Normal (Web)'?
Hi, I'm using Word as my e-mail editor in Outlook 2003 and want to change the default Style for e-mails from 'Normal' to 'Normal (Web)'. The problem is that new e-mails and replies in HTML format use the 'Normal' Microsoft Word 'Style', and this has no gap after paragraphs. The upshot of this is that when sending an e-mail, I have to press return twice to create a gap, but when the recipient views this, their software shows it as four gaps (the extra carriage return I typed + their correctly viewed HTML carriage return after each line). E.g. I type this: ...

How To Copy MS Word mailing labels into Excel
I have a word doc that I want to put into Excel. I want to add some more fields to the names and addresses. Is this simple or do I have to learn how to program? Michael Rodriguez City of Grand Prairie Michael, have you tried to copy and paste the data into excel? -- Paul B Always backup your data before trying something new Please post any response to the newsgroups so others can benefit from it Feedback on answers is always appreciated! Using Excel 2000 & 97 ** remove news from my email address to reply by email ** "Michael Rodriguez" <mrodrigu@gptx.org> wrote in messa...

Planned Open Market Days
A spreadsheet named "NYSE Holidays" contains NYSE Planned Holidays for 2005 and 2006; containing data in columns A and B: New Year's Day 01/01/05 Martin Luther King, Jr. Day 01/17/05 Washington's Birthday 02/21/05 Good Friday 03/25/05 Memorial Day 05/30/05 Independence Day 07/04/05 Labor Day 09/05/05 Thanksgiving Day 11/24/05 Christmas 12/26/05 New Year's Day 01/02/06 Martin Luther King, Jr. Day 01/16/06 Washington's Birthday 02/20/06 Good Friday 04/14/06 Memorial Day 05/29/06 Independence Day 07/04/06 Labor Day 09/04/06 Thanksgiving Day 11/23/06 Christmas 12/25/06 ...

Linker Error after upgrade from VC7.1
Hello all, After upgrading a VC7.1 project to visual studio 2005, it failed to build in the release configuration with the follwoing error : 1>nafxcw.lib(winocc.obj) : error LNK2005: "public: class CWnd * __thiscall CWnd::GetDlgItem(int)const " (?GetDlgItem@CWnd@@QBEPAV1@H@Z) already defined in InstallDlg.obj The debug build works fine. The project uses MFC in a static library. Well, after doing some research, it seems that this one is tied to the fact that in a release configuration, _AFX_ENABLE_INLINES is defined, so inline functions are embedded in the .obj file. Sure there...

Where is the workspace file stored?
I was given a project folder containing several dozen files. So where is the workspace file normally located? If I don't have a workspace file how can I cerate one? Using VC version 6. TIA I haven't used VC6 for some time, but if I remember right you can just open the .dsp file and it will create a .dsw file for you. It typically goes in the same folder with the code. Tom "Phisherman" <noone@nobody.com> wrote in message news:be93539ccf8a6f25ibh4vt6ggmtbi024mq@4ax.com... >I was given a project folder containing several dozen files. So where > is the wor...

Unexpected error message on closing an Excel file
Suddenly I am getting the following message when I try to close a workbook: "Your formula contains an invalid external reference to a worksheet. Verify that the path, workbook, and range name or cell reference are correct, and try again" The mysterious thing is that it does not happen consistently and that, after I click OK after the above message, I can still save the file. What might be the cause of this error message and can the "invalid reference" be tracked down using one of the utility add-ins such as J. Walkenbach's PUP? If it only happens when you close ...

Change File Locations to Private Drive (not Folder)
Hi, I know that I can use "File Locations" in "Options" so that whenever I use the "Open..." command in Word, it will open to a specific folder. I'm wondering if there is a way that this can be applied not to a folder but to a specific drive on a network. Our company has a main public drive and has also assigned each of the Staff their own private drive. Is there a way to access the "main page" (for lack of a better term) of my private drive each time I use "Open..." in Word? Right now it goes to "My Computer" or ...

cant start outlook pst file to large
Hi I hope somebody may be able to help im new to outlook and now I cant start outlook message says cannot open your default email folders pst file its too large as I cannot open outlook I cannot delete old folders See if this helps: http://support.microsoft.com/kb/296088 -- -Ben- Ben M. Schorr, MVP Roland Schorr & Tower http://www.rolandschorr.com http://www.officeforlawyers.com/outlook.html Author: The Lawyer's Guide to Microsoft Outlook 2007: http://tinyurl.com/ol4law-amazon "Ray" <Ray@discussions.microsoft.com> wrote in message news:B3B824DC-3C9B-4B1B-8EF3-61...

Opening Excel Workbooks
I'm running into an issue where if I click on an Excel file through My Documents, it doesn't automatically bring it up. I get the toolbar but the actual spreadsheet doesn't appear on the screen. I have to click on the taskbar to get it to pop up. If I already have Excel active and I open a file through Excel, this doesn't happen. Any ideas? Here is a similar thread: http://www.excelforum.com/showthread.php?s=&threadid=237195 Rolli -- Message posted from http://www.ExcelForum.com Hi, Take a look at Tools-Options-General tab- uncheck ignore other application...

Invalid XML error when I open customization setting
I have a problem when I try to open customization setting after I import an entity. The system errored "Invalid XML" "The XML passed to the platform is not well-formed XML". Please recommend how to resolve this problem. Thanks. ...

DNS Error on Exchange
I am getting the following error on my Exchange server. What is my problem? Thanks. Event Type: Warning Event Source: smtpsvc Event Category: None Event ID: 2012 Date: 1/28/2005 Time: 12:01:53 PM User: N/A Computer: PUMA Description: SMTP could not connect to the DNS server '24.220.0.11'. The protocol used was 'UDP'. It may be down or inaccessible. For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp. Data: 0000: d5 04 00 00 Õ... Is that a DNS server that's configured on your Exchange box? It shoul...

error 0x800cc0f
i installed windows xp, and i set up all my email accounts. they are all working , except one: i receive 0x800cc0f message, which states that the service has been interrupted, contact your ISP...., but this is not the case, since my internet conneciton is working fine all the account settings are correct I am having the same problem. I have to close outlook and reopen to retrieve all of my messages. Have you found a resolution yet? "Kerstin" wrote: > i installed windows xp, and i set up all my email > accounts. they are all working , except one: i receive > 0x800c...

opening .bak file
Hi, I hope someone can help! I recently was performing a compacting operation on my outlook express folders. My computer shutdown due to a power failure and I lost some emails from a few of my folders. I was however able to get the .bak files (of the .dbx files that were lost) out of the recycle bin. If I could open one of these .bak files or convert it back to the .dbx file from which it was created I would retrieve these emails. Can anyone instruct me as to open this .bak file? Thanks for any help! Arnie K. How did you get the bak files out of the Recycle Bin? All e...

Trying to read XML file into dataset
Hello. Developing a web site in VS2005, SP1, VB, .NET 2.0, ASP.NET 2.0 on XP Pro, SP2. I eventually want to use a gridview table to view xml data, but right now i can't seem to get my xml data into a dataset so that i can use it. I have an XML file and can open it in IE. There is no XSD or XSL file to go with it. I can't seem to get the XML data into a dataset. I tried using the following code, but it just does nothing. It doesn't give an error. It just executes the code and does nothing. Dim dataSet As DataSet = New DataSet dataSet.ReadXml("...

error on upgrade: ID 4386
Hello, I am upgrading from DPM 2010 RC to DPM 2010 RTM, 64 bit version, on Win 2008 R2 standard. The RC is working without any issues. The upgrade scenario is supported. At the very end of the process the upgrade fails giving me the following. _____ The SQL Server installation failed because a restart was pending on this computer. Restart the computer and then start DPM Setup again. ID: 4386. Details: Unknown error (0x84be0bc2) _____ Restarting the server does not correct the issue. On the next attempt I am getting the same error message. Where to look for the pending rest...

How do I save a Publisher Document as a JPEG file?
I have multliple scanned photos that posted to a Publisher document and I need to email it. I want to save the document as Jpeg, but it doesn't give me that option even when I choose "Save As". Please help!!! I desperately need to sent this email and it's not working!! Desperately seeking jpeg wrote: > I have multliple scanned photos that posted to a > Publisher document and I need to email it. I want to > save the document as Jpeg, but it doesn't give me that > option even when I choose "Save As". Please help!!! I > desperately need to...

Accessing the same PST file from multiple WinXP Pro IDs
I am running a Windows NT 4.0 network with workstations with Windows XP Pro. One user has Outlook 2000 on his notebook. He has a profile to log on to the machine itself (i.e. not on the Windows NT domain) for when he's "on the road" and one for logging on to the NT network domain to use the printers and network facilities. On my personal notebook I have Office XP and I was able to configure Outlook's data files (Tools -> Options -> Mail Setup -> Data Files) so that I would access the same PST file under both profiles. I cannot figure out how/if this is poss...

Send/Recieve error #3
I had few viruses in my computer that I cleaned up. Ever since, I face send/recieve error in my pop3 email account. I think I deleted a driver or somthing. Any idea? ...