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
-
Edge Seems To Be Gaining Weight
by
bbearren
48 minutes ago -
Rufus is available from the MSFT Store
by
PL1
7 hours, 16 minutes ago -
Microsoft : Ending USB-C® Port Confusion
by
Alex5723
9 hours, 25 minutes ago -
KB5061768 update for Intel vPro processor
by
drmark
5 hours, 39 minutes ago -
Outlook 365 classic has exhausted all shared resources
by
drmark
7 hours, 36 minutes ago -
My Simple Word 2010 Macro Is Not Working
by
mbennett555
5 hours, 11 minutes ago -
Office gets current release
by
Susan Bradley
7 hours, 48 minutes ago -
FBI: Still Using One of These Old Routers? It’s Vulnerable to Hackers
by
Alex5723
1 day, 21 hours ago -
Windows AI Local Only no NPU required!
by
RetiredGeek
1 day, 6 hours ago -
Stop the OneDrive defaults
by
CWBillow
1 day, 22 hours ago -
Windows 11 Insider Preview build 27868 released to Canary
by
joep517
2 days, 8 hours ago -
X Suspends Encrypted DMs
by
Alex5723
2 days, 10 hours ago -
WSJ : My Robot and Me AI generated movie
by
Alex5723
2 days, 11 hours ago -
Botnet hacks 9,000+ ASUS routers to add persistent SSH backdoor
by
Alex5723
2 days, 11 hours ago -
OpenAI model sabotages shutdown code
by
Cybertooth
2 days, 12 hours ago -
Backup and access old e-mails after company e-mail address is terminated
by
M W Leijendekker
2 days ago -
Enabling Secureboot
by
ITguy
2 days, 7 hours ago -
Windows hosting exposes additional bugs
by
Susan Bradley
2 days, 20 hours ago -
No more rounded corners??
by
CWBillow
2 days, 16 hours ago -
Android 15 and IPV6
by
Win7and10
2 days, 5 hours ago -
KB5058405 might fail to install with recovery error 0xc0000098 in ACPI.sys
by
Susan Bradley
3 days, 8 hours ago -
T-Mobile’s T-Life App has a “Screen Recording Tool” Turned on
by
Alex5723
3 days, 11 hours ago -
Windows 11 Insider Preview Build 26100.4202 (24H2) released to Release Preview
by
joep517
3 days, 5 hours ago -
Windows Update orchestration platform to update all software
by
Alex5723
3 days, 18 hours ago -
May preview updates
by
Susan Bradley
3 days, 6 hours ago -
Microsoft releases KB5061977 Windows 11 24H2, Server 2025 emergency out of band
by
Alex5723
2 days, 21 hours ago -
Just got this pop-up page while browsing
by
Alex5723
3 days, 10 hours ago -
KB5058379 / KB 5061768 Failures
by
crown
3 days, 7 hours ago -
Windows 10 23H2 Good to Update to ?
by
jkitc
2 days, 10 hours ago -
At last – installation of 24H2
by
Botswana12
4 days, 10 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.