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
![]() |
There are isolated problems with current patches, but they are well-known and documented on this site. |
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, 6 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
-
ChatGPT 5 release date: what we know about OpenAI’s next chatbot (Awaiting moderation)
by
Macronwill
27 minutes ago -
CD/DVD drive is no longer recognized
by
WSCape Sand
2 hours, 19 minutes ago -
Windows 11 24H2 Default Apps stuck on Edge and Adobe Photoshop
by
MikeBravo
5 hours, 8 minutes ago -
North Face and Cartier customer data stolen in cyber attacks
by
Alex5723
3 hours, 14 minutes ago -
What is wrong with simple approach?
by
WSSpoke36
3 hours, 6 minutes ago -
Microsoft-Backed Builder.ai Set for Bankruptcy After Cash Seized
by
Alex5723
14 hours, 38 minutes ago -
Location, location, location
by
Susan Bradley
1 hour, 40 minutes ago -
Cannot get a task to run a restore point
by
CWBillow
16 hours, 4 minutes ago -
Frustrating search behavior with Outlook
by
MrJimPhelps
6 hours, 48 minutes ago -
June 2025 Office non-Security Updates
by
PKCano
1 day, 2 hours ago -
Secure Boot Update Fails after KB5058405 Installed
by
SteveIT
8 hours, 53 minutes ago -
Firefox Red Panda Fun Stuff
by
Lars220
1 day, 2 hours ago -
How start headers and page numbers on page 3?
by
Davidhs
1 day, 13 hours ago -
Attack on LexisNexis Risk Solutions exposes data on 300k +
by
Nibbled To Death By Ducks
15 hours, 52 minutes ago -
Windows 11 Insider Preview build 26200.5622 released to DEV
by
joep517
1 day, 21 hours ago -
Windows 11 Insider Preview build 26120.4230 (24H2) released to BETA
by
joep517
1 day, 21 hours ago -
MS Excel 2019 Now Prompts to Back Up With OneDrive
by
lmacri
1 day, 11 hours ago -
Firefox 139
by
Charlie
1 day, 4 hours ago -
Who knows what?
by
Will Fastie
6 hours, 32 minutes ago -
My top ten underappreciated features in Office
by
Peter Deegan
1 day, 22 hours ago -
WAU Manager — It’s your computer, you are in charge!
by
Deanna McElveen
1 hour, 27 minutes ago -
Misbehaving devices
by
Susan Bradley
18 hours, 19 minutes ago -
.NET 8.0 Desktop Runtime (v8.0.16) – Windows x86 Installer
by
WSmeyerbos
3 days, 4 hours ago -
Neowin poll : What do you plan to do on Windows 10 EOS
by
Alex5723
3 hours, 24 minutes ago -
May 31, 2025—KB5062170 (OS Builds 22621.5415 and 22631.5415 Out-of-band
by
Alex5723
3 days, 3 hours ago -
Discover the Best AI Tools for Everything
by
Alex5723
2 days, 2 hours ago -
Edge Seems To Be Gaining Weight
by
bbearren
2 days, 17 hours ago -
Rufus is available from the MSFT Store
by
PL1
3 days, 1 hour ago -
Microsoft : Ending USB-C® Port Confusion
by
Alex5723
4 days, 4 hours ago -
KB5061768 update for Intel vPro processor
by
drmark
2 days, 4 hours 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.