Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shell() Problem

Status
Not open for further replies.

SimonFinn

Programmer
Mar 13, 2003
130
GB
Hi Guys

Im using shell() to open a word file, i currently have

Call Shell("C:\Program Files\Microsoft Office\Office10\WINWORD.EXE""C:\MailMerge\MailMerge2.doc", 1)

And it says file not found (i have checked both paths and they are both correct.
ive also tried:
Call Shell("WINWORD.EXE""C:\MailMerge\MailMerge2.doc", 1)

What am i doing wrong?

Thanks Si
 
hi

try this coding. if u are going to open a word file u can just use the shell function as follows

call func
sub func()
shell ("C:\program files\microsoft office\word1.doc",1)
end sub

good luck
 
Hi

when i input

Shell ("C:\MailMerge\MailMerge2.doc", 1)

i get the error "Expected ="

if i use call, in front, when i run the program i get:

Runtime error '5', invalid call or arguement

Thanks Si
 
Got it

Call Shell("C:\Program Files\Microsoft Office\Office10\WINWORD.EXE C:\MailMerge\MailMerge2.doc", 1)

thanks jpraman
 
try

Code:
rc = shell("winword c:\mailmerge\mailmerge2.doc")
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top