Senin, 19 September 2011

[MS_AccessPros] Re: Calling WordPad from Access and file not found

 

David

I made one mistake that I could spot. There is an extra Chr(34).

Try this one:
Chr(34) _
& "C:\Program Files\Windows NT\Accessories\Wordpad.exe " _
& Chr(34) _
& "C:\Users\David\My Documents\Independent Auto - Help - " _
& "Repair Order.rtf" & Chr(34)

Bill

--- In MS_Access_Professionals@yahoogroups.com, "David Tolson" <drtolson@...> wrote:
>
> Thanks Bill, I'm halfway there. Wordpad opened, but the file didn't open. I
> copied and pasted your code, and couldn't get the help file to open.
>
>
>
> r/David
>
>
>
> From: MS_Access_Professionals@yahoogroups.com
> [mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of Bill Mosca
> Sent: Monday, September 19, 2011 10:47 AM
> To: MS_Access_Professionals@yahoogroups.com
> Subject: [MS_AccessPros] Re: Calling WordPad from Access and file not found
>
>
>
>
>
> David
>
> Shell is a curious creature. It does not handle spaces well. Do this
> instead, surrounding each string with Chr(34) which is a double-quote:
>
> RetVal = Shell(Chr(34) _
> & "C:\Program Files\Windows NT\Accessories\Wordpad.exe " _
> & Chr(34) & Chr(34) _
> & "C:\Users\David\My Documents\Independent Auto - Help - " _
> & "Repair Order.rtf" & Chr(34), 1)
>
> Regards,
> Bill Mosca, Founder - MS_Access_Professionals
> http://www.thatlldoit.com
> Microsoft Office Access MVP
> https://mvp.support.microsoft.com/profile/Bill.Mosca
>
> --- In MS_Access_Professionals@yahoogroups.com
> <mailto:MS_Access_Professionals%40yahoogroups.com> , "djsdaddy531"
> <drtolson@> wrote:
> >
> > Great Day, I have created a help file that opens MS WordPad and then I
> expect the code to open the help file. I use the following code:
> >
> >
> > Private Sub btnHelp_Click()
> >
> > On Error GoTo Err_btnHelp_Click
> >
> > Dim RetVal As Long
> > RetVal = Shell("C:\Program Files\Windows NT\Accessories\Wordpad.exe " &
> "C:\Users\David\My Documents\Independent Auto - Help - Repair Order.rtf", 1)
> >
> > Exit_btnHelp_Click:
> > Exit Sub
> >
> > Err_btnHelp_Click:
> > MsgBox Err.Description
> > Resume Exit_btnHelp_Click
> >
> >
> > End Sub
> >
> >
> > I receive the WordPad error:
> >
> > C:\Users\David\My
> > Cannot fine this file
> > Please verify that the correct path and file name are given.
> >
> > I have checked the path in the code and to the best of understanding, it
> appears to be correct. When I open WordPad from the Microsoft Start button,
> I can open the file.
> >
> > Thanks in advance for the assistance.
> >
> > r/David
> >
>
>
>
>
>
> [Non-text portions of this message have been removed]
>

__._,_.___
Recent Activity:
MARKETPLACE

Stay on top of your group activity without leaving the page you're on - Get the Yahoo! Toolbar now.


A bad score is 579. A good idea is checking yours at freecreditscore.com.
.

__,_._,___

Tidak ada komentar:

Posting Komentar