The following works in Win98/Office2000 but not in Win2000/OfficeXP
Dim strAppName As String
strAppName = “C:Program FilesMicrosoft OfficeOfficeWinword.exe”
Call Shell (strAppName & “””C:My DocumentsMy Test.doc”””, 1)
Any one have any ideas? Thanks
Paul
![]() |
Patch reliability is unclear, but widespread attacks make patching prudent. Go ahead and patch, but watch out for potential problems. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Running Shell
Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Running Shell
- This topic has 13 replies, 4 voices, and was last updated 23 years, 5 months ago.
AuthorTopicWSpbricker
AskWoody LoungerNovember 29, 2001 at 6:33 pm #363547Viewing 0 reply threadsAuthorReplies-
WScharlotte
AskWoody LoungerNovember 30, 2001 at 3:25 am #555091 -
WSpbricker
AskWoody LoungerNovember 30, 2001 at 2:35 pm #555267Thanks for looking at this Charlotte. This is the exact code used to get to Word.
Dim stAppName
stAppName = “C:Program FilesMicrosoft OfficeOffice10WINWORD.EXE”
Call Shell(stAppName & “””C:My DocumentsMy Test.doc”””, 1)Bombs on error 53 File Not Found. This code works in Win98/Office2000 (changing Office10 to Office). Someone suggested I move the “”” to C:”””My DocumentsMy Test.doc””” but I am trying to ferret out this problem for someone else and don’t have Win2000 loaded on my machine so I can’t test it. Care to help here. Thanks
Paul -
WSDouglas Martin
AskWoody LoungerNovember 30, 2001 at 7:36 pm #555339I have never used Shell, so this may be way out in left field. However, I wonder if adding a space after WINWORD.EXE and before the ” would help? I know you said the it worked before, but I wonder if your new system is pickier about spaces? The way you have it, there will be no space between WINWORD.EXE and the “C:My Documents… stuff
-
WSpbricker
AskWoody LoungerNovember 30, 2001 at 8:01 pm #555342Thanks for the thought, but any space between the ” marks and the Path to the file makes things worse, at least in Win98. The “”” marks need to be snugged up agains the text. I don’t have win2000 so I can’t test any of this myself but it’s unbelieveable that you would have to eliminate spaces in 2000 when you can use them in path names in 98. I’m trying to help someone on another forum and no one has been able to provide a solution.
Thanks again
Paul
-
-
WScharlotte
AskWoody LoungerDecember 1, 2001 at 2:43 am #555368OK, did you check to make sure that Winword.exe *is* in that location? If it is, try using short paths. I’ve had trouble with Shell when there were spaces in the path names, althouth it seems to me someone here in the Lounge indicated that they’d found a way to deal with that. Try using “C:Progra~1Micros~1Office10Winword.exe” for the stAppName, or substitute the appropriate number for Micros~1 if you have other folders that start like that.
You might want to take a look at this post which shows the use of the GetShortPathName API call to return a pathname without spaces. That might solve your shell problem for you.
-
WSpbricker
AskWoody LoungerDecember 1, 2001 at 12:12 pm #555386Good morning. We ended up using GetObject(). He was able to open the files he needed and that solved the problem. One of the interesting parts to this whole things is that the Path to the .exe could have spaces in it. It was the Path to the .doc file that bombed with spaces. I haven’t found the answer but I don’t need this to go any further because he’s going a different route, thanks for the suggestions.
Paul -
WScharlotte
AskWoody Lounger -
WSpbricker
AskWoody Lounger
-
-
-
-
WSAndyAinscow
AskWoody Lounger -
WSpbricker
AskWoody LoungerDecember 2, 2001 at 10:51 am #555538That’s a great alternative. Thanks. The problem we are having is with the .doc path and not the .exe path. It seems that you can have spaces in the .exe path without problems arising. It’s when you have spaces in the path to the .doc file that you error out. In Win98 “””C:My DocumentsMy Text.doc””” works, but the same line in Win2000 doesn’t. We’ve been looking for anything that does work.
Paul -
WSAndyAinscow
AskWoody LoungerDecember 2, 2001 at 4:57 pm #555562Try something like (construct as a string prior to the shell command)
“‘C:path to winwordwinword.exe’ ‘C:My DocumentsMy Text.doc'”
Note the single spaces. (I use Win2000 and can open documents/other files with a space in the path using code).
A general point. Also consider the CreateProcess call (Windows API). It’s a pig to use but you have far more control than with the shell command. For example you can force Access to wait until the ‘shelled’ process has finished.
-
WSpbricker
AskWoody Lounger -
WSAndyAinscow
AskWoody Lounger
-
-
-
-
Viewing 0 reply threads -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Mudança Interestadual: Dicas Essenciais para Clientes Satisfeitos (Awaiting moderation)
by
evdisaac133
2 hours, 32 minutes ago -
Why It’s Time to Upgrade from Windows 7 to Windows 10 (Awaiting moderation)
by
kasfiya
4 hours, 45 minutes ago -
We live in a simulation
by
Alex5723
5 hours, 5 minutes ago -
Netplwiz not working
by
RetiredGeek
4 hours, 27 minutes ago -
Windows 11 24H2 is broadly available
by
Alex5723
17 hours, 33 minutes ago -
Microsoft is killing Authenticator
by
Alex5723
1 hour, 3 minutes ago -
Downloads folder location
by
CWBillow
1 day ago -
Remove a User from Login screen
by
CWBillow
3 hours, 11 minutes ago -
TikTok fined €530 million for sending European user data to China
by
Nibbled To Death By Ducks
15 hours, 5 minutes ago -
Microsoft Speech Recognition Service Error Code 1002
by
stanhutchings
15 hours, 8 minutes ago -
Is it a bug or is it expected?
by
Susan Bradley
19 hours, 46 minutes ago -
Image for Windows TBwinRE image not enough space on target location
by
bobolink
14 hours, 16 minutes ago -
Start menu jump lists for some apps might not work as expected on Windows 10
by
Susan Bradley
1 day, 14 hours ago -
Malicious Go Modules disk-wiping malware
by
Alex5723
1 day, 3 hours ago -
Multiple Partitions?
by
CWBillow
1 day, 4 hours ago -
World Passkey Day 2025
by
Alex5723
1 day, 21 hours ago -
Add serial device in Windows 11
by
Theodore Dawson
2 days, 13 hours ago -
Windows 11 users reportedly losing data due forced BitLocker encryption
by
Alex5723
13 hours, 58 minutes ago -
Cached credentials is not a new bug
by
Susan Bradley
2 days, 17 hours ago -
Win11 24H4 Slow!
by
Bob Bible
2 days, 17 hours ago -
Microsoft hiking XBox prices starting today due to Trump’s tariffs
by
Alex5723
2 days, 15 hours ago -
Asus adds “movement sensor” to their Graphics cards
by
n0ads
2 days, 20 hours ago -
‘Minority Report’ coming to NYC
by
Alex5723
2 days, 16 hours ago -
Apple notifies new victims of spyware attacks across the world
by
Alex5723
3 days, 4 hours ago -
Tracking content block list GONE in Firefox 138
by
Bob99
3 days, 4 hours ago -
How do I migrate Password Managers
by
Rush2112
2 days, 11 hours ago -
Orb : how fast is my Internet connection
by
Alex5723
2 days, 13 hours ago -
Solid color background slows Windows 7 login
by
Alex5723
3 days, 16 hours ago -
Windows 11, version 24H2 might not download via Windows Server Updates Services
by
Alex5723
3 days, 14 hours ago -
Security fixes for Firefox
by
Susan Bradley
16 hours, 8 minutes ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.