From: Mike S on
On 6/13/2010 7:08 PM, Viper900 wrote:
>
> Thank you Mike S, your link solved the problem

Did you have a chance to test it on any 64-bit OS?

Mike
> "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

From: Karl E. Peterson on
Mike S wrote on 6/13/2010 :
> On 6/13/2010 7:08 PM, Viper900 wrote:
>>> 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
>>
>> Thank you Mike S, your link solved the problem
>
> Did you have a chance to test it on any 64-bit OS?

What's the concern on x64?


From: Mike S on
On 6/14/2010 12:54 PM, Karl E. Peterson wrote:
> Mike S wrote on 6/13/2010 :
>> On 6/13/2010 7:08 PM, Viper900 wrote:
>>>> 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
>>>
>>> Thank you Mike S, your link solved the problem
>>
>> Did you have a chance to test it on any 64-bit OS?
>
> What's the concern on x64?

The MS site support.microsoft.com/kb/170918 lists it as 32-bit:
How To Use ShellExecute to Launch Associated File (32-bit)
I was wondering how a 64-bit OS would handle it. Will it work, or will
it create an error?
From: Karl E. Peterson on
After serious thinking Mike S wrote :
> On 6/14/2010 12:54 PM, Karl E. Peterson wrote:
>> Mike S wrote on 6/13/2010 :
>>> On 6/13/2010 7:08 PM, Viper900 wrote:
>>>>> 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
>>>>
>>>> Thank you Mike S, your link solved the problem
>>>
>>> Did you have a chance to test it on any 64-bit OS?
>>
>> What's the concern on x64?
>
> The MS site support.microsoft.com/kb/170918 lists it as 32-bit:
> How To Use ShellExecute to Launch Associated File (32-bit)
> I was wondering how a 64-bit OS would handle it. Will it work, or will it
> create an error?

Works here. There may be another 64-bit option, for 64-bit processes
to call, but that's pretty irrelevent for Classic VB apps. :-)

--
..NET: It's About Trust! http://vfred.mvps.org
Customer Hatred Knows No Bounds at MSFT
ClassicVB Users Regroup! comp.lang.basic.visual.misc
Free usenet access at http://www.eternal-september.org


From: MikeD on


"Shotgun Thom" <tmoran4511(a)gmail.com> wrote in message
news:e6cd9325-acf5-4766-9d4d-9a8c8fb5347f(a)z13g2000prh.googlegroups.com...
> 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

Not a good idea to rely specifically on Write.exe or Wordpad.exe to even
exist, let alone assume a specific path. I've known people to have removed
one or even both of those programs simply because they use some other
program to open .doc, .rtf, and/or .txt files. Much better to open the file
in whatever program is associated with its extension (which is what
ShellExecute does).

--
Mike


First  |  Prev  |  Next  |  Last
Pages: 1 2 3 4
Prev: Newsgroup Confusion
Next: List box hover mouse expand text