Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old October 8th, 2004, 04:06 AM
Registered User
 
Join Date: Oct 2004
Location: , , .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to underscore10304
Default Shell command refusing to work

Hi All,
Hoping someone can help with following prob...
I'm not necessarily new to access but am new to VBA and simply CANNOT get my head round a particular line of code.
I'll explain:
- I have a link that should, when clicked, minimise the active form ( a dialog box w/dropdown ) and launch an external, pre-saved MSWord doc.
Am writing it as follows:

DoCmd.Minimize
Shell ("D:\IT\Display Outlets 2004\merge4access.doc")

...Is it me or am I just not writing this properly? The result is the standard debug/end error popup.
I then typed w/out the preceding 'DoCmd' - this was also unsuccessful.
Every example of the shell command I've looked at is written like this. What am I doing wrong?
Thanks...


Reply With Quote
  #2 (permalink)  
Old October 8th, 2004, 04:53 AM
Authorized User
 
Join Date: Jul 2003
Location: Stockton on Tees, , United Kingdom.
Posts: 73
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I suspect that you need to add the path to the Word program as well:

i.e. Shell ("C:|Program Files\.....\Word.exe" "D:\IT\Display Outlets 2004\merge4access.doc")

Cheers Ray
Reply With Quote
  #3 (permalink)  
Old October 8th, 2004, 05:08 AM
Registered User
 
Join Date: Oct 2004
Location: , , .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to underscore10304
Default

Hi,
Thanks for your response but I still don't know how to write this line.
It's asking for a separator.
How do I differentiate between the path to the app, THEN the path to the file?
Confused.
Thanks again!

Reply With Quote
  #4 (permalink)  
Old October 8th, 2004, 01:13 PM
Authorized User
 
Join Date: Oct 2003
Location: Cleveland, OH, USA.
Posts: 75
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Have you tried putting a space between the program and file/path like this?

Shell ("C:\Program Files\.....\Word.exe D:\IT\Display Outlets 2004\merge4access.doc")
Reply With Quote
  #5 (permalink)  
Old October 20th, 2004, 02:12 PM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Hi,

   I am not sure what part of this you are having a problem with still. I wrote this code sample and it does the following:
Minimizes the FORM, not Access
Opens Windows Explorer to the link specified.

Maybe your answer is somewhere here...

Private Sub btn0_Click()

    Dim objExplorer
    Dim stLink As String

    stLink = "http://www.msn.com"

    DoCmd.Minimize

    Set objExplorer = CreateObject("InternetExplorer.Application")
        objExplorer.Navigate stLink
        objExplorer.Fullscreen = True
        objExplorer.Visible = 1

End Sub

 I think you need to create an instance of Word. I think you need the object model for Word. I only have the model for IE.

P.S. Omit the Full Screen command since it opens IE and hides the taskbar, menus and close button.
P.P.S. It is not a shell script, that is only used in cmd.exe (e.g. batch files) so don't use shell command references. If this is not a VBA question, then seek the more pertinent forum.:D



mmcdonal
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Running a shell command in sharepoint. Final_Boss SharePoint Development 0 August 17th, 2007 12:24 PM
Shell command under Windows Vista mileski Access VBA 0 April 16th, 2007 10:17 AM
how to alter shell command to direct where window dgr7 Beginning VB 6 4 March 16th, 2007 02:00 PM
Shell command or calling VB exe netfresher General .NET 3 October 30th, 2006 05:23 AM
Shell command execution error toshesh VB Databases Basics 3 January 7th, 2006 02:17 AM



All times are GMT -4. The time now is 02:28 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.