From: Larry Serflaten on

"Viper900" <Viper900(a)discussions.microsoft.com> wrote
> Sorry
> I should have explained myself better. I am making a help file for a program
> that i am writing, as notepad does'nt want to work with pictures, i changed
> it to wordpad. and used this:
>
> Shell" wordpad.exe" & App.path +"\Indexhelp.rtf",vbnormal focus
>
> btw that line won't work

First make sure that windows can find wordpad:

Shell "wordpad.exe"

If you get an error there, the rest won't matter. After you get that to work
(by including the full path to wordpad if you must), then test the rest of it.
Be sure to test the condition where App.Path equates to a path that has
spaces in it. (C:\Documents and Setttings\ ... ) You may need to wrap
double quotes around that whole path to your help file.

LFS


From: Mike S on
On 6/11/2010 5:15 AM, Larry Serflaten wrote:
> "Viper900"<Viper900(a)discussions.microsoft.com> wrote
>> Sorry
>> I should have explained myself better. I am making a help file for a program
>> that i am writing, as notepad does'nt want to work with pictures, i changed
>> it to wordpad. and used this:
>>
>> Shell" wordpad.exe"& App.path +"\Indexhelp.rtf",vbnormal focus
>>
>> btw that line won't work
>
> First make sure that windows can find wordpad:
>
> Shell "wordpad.exe"
>
> If you get an error there, the rest won't matter. After you get that to work
> (by including the full path to wordpad if you must), then test the rest of it.
> Be sure to test the condition where App.Path equates to a path that has
> spaces in it. (C:\Documents and Setttings\ ... ) You may need to wrap
> double quotes around that whole path to your help file.
>
> LFS

If you don't have wordpad, or if you want to let Windows use the
associated program you might consider using this approach, I'm not sure
how it would work on a 64-bit OS though:

How To Use ShellExecute to Launch Associated File (32-bit)
http://support.microsoft.com/kb/170918

FindExecutable: Find Exe Associated with a Registered Extension
http://vbnet.mvps.org/index.html?code/system/findexecutable.htm

Mike



From: Viper900 on


"Viper900" wrote:

> Hi
> What di I have to change about this line of code so that it can open wordpad
> files.
>
> Shell "notepad.exe " & App.Path + "\IndexHelp.txt", vbNormalFocus
>
> thanks you
>
> I think I have found the problem, windows can't find wordpad.exe. I did a search on wordpad.exe, and did not get a result. in XP
From: Shotgun Thom on
On Jun 12, 6:54 pm, Viper900 <Viper...(a)discussions.microsoft.com>
wrote:
> "Viper900" wrote:
> > Hi
> > What di I have to change about this line of code so that it can open wordpad
> > files.
>
> > Shell "notepad.exe " & App.Path + "\IndexHelp.txt", vbNormalFocus
>
> >  thanks you
>
> > I think I have found the problem, windows can't find wordpad.exe. I did a search on wordpad.exe, and did not get a result. in XP- Hide quoted text -
>
> - Show quoted text -

Notepad doesn't require a full path because it's in the Windows System
32 directory. WordPad is not.

However... here's an old trick. Use write.exe. write.exe is in the
system 32 folder and, when run, starts wordpad. So just run:

Shell "write.exe " & App.Path & "\indexhelp.txt", vbNormalFocus
From: Viper900 on
Thank you Mike S, your link solved the problem

"Mike S" wrote:

> On 6/11/2010 5:15 AM, Larry Serflaten wrote:
> > "Viper900"<Viper900(a)discussions.microsoft.com> wrote
> >> Sorry
> >> I should have explained myself better. I am making a help file for a program
> >> that i am writing, as notepad does'nt want to work with pictures, i changed
> >> it to wordpad. and used this:
> >>
> >> Shell" wordpad.exe"& App.path +"\Indexhelp.rtf",vbnormal focus
> >>
> >> btw that line won't work
> >
> > First make sure that windows can find wordpad:
> >
> > Shell "wordpad.exe"
> >
> > If you get an error there, the rest won't matter. After you get that to work
> > (by including the full path to wordpad if you must), then test the rest of it.
> > Be sure to test the condition where App.Path equates to a path that has
> > spaces in it. (C:\Documents and Setttings\ ... ) You may need to wrap
> > double quotes around that whole path to your help file.
> >
> > LFS
>
> If you don't have wordpad, or if you want to let Windows use the
> associated program you might consider using this approach, I'm not sure
> how it would work on a 64-bit OS though:
>
> How To Use ShellExecute to Launch Associated File (32-bit)
> http://support.microsoft.com/kb/170918
>
> FindExecutable: Find Exe Associated with a Registered Extension
> http://vbnet.mvps.org/index.html?code/system/findexecutable.htm
>
> Mike
>
>
>
> .
>
First  |  Prev  |  Next  |  Last
Pages: 1 2 3 4
Prev: Newsgroup Confusion
Next: List box hover mouse expand text