Re: Problem passing argument ShellExecute

From: Stefan Merwitz (nospam_at_thisserverdoesntexist.com)
Date: 08/10/04


Date: Tue, 10 Aug 2004 18:45:04 +0200

Oh, there was a mistake!
it must be:

Dim bSuccessFull As Boolean
On Error Resume Next
bSuccessFull = ShellExecute(Me.hwnd, "open", & _
  "C:\Program Files\Microsoft Office\Office\MSACCESS.EXE", & _
  """C:\Program Files\abc\abc application.mde"" " & _
  "/wrkgrp ""C:\ABC\ABC Data\Data\abc workgroupinfofile.mdw""", & _
  "" ,1) > 32

Sorry,

Stefan

-- 
___________________________________www.VBTricks.de.vu
the free resource for Visual Basic, Gambas and Pascal
components, tips & complete projects
www:  http://www.VBTricks.de.vu
mail: vbtricks <at> my-mail <dot> ch
_____________________________________________________
Stefan Merwitz wrote:
 > I guess your problem are the long filenames? Shellexecute does accept
 > long filename's enclosed in "s, too. To use "s in strings, just replace
 > every occurence of a "s with two "s:
 >
 > e.g.
 >  - this is a "test", yes it is  --> "this is a ""test"", yes it is"
 >  - this is a "test"             --> "this is a ""test"""
 >  - "                            --> """"
 >
 > To execute...
 >
 > "C:\Program Files\Microsoft Office\Office\MSACCESS.EXE" "C:\Program
 > Files\abc\abc application.mde" /wrkgrp "C:\ABC\ABC Data\Data\abc
 > workgroupinfofile.mdw"
 >
 > ...use the following source:
 >
 > Private Declare Function ShellExecute Lib "shell32.dll" & _
 >  Alias "ShellExecuteA" (ByVal hwnd As Long, & _
 >  ByVal lpOperation As String, ByVal lpFile As String, & _
 >  ByVal lpParameters As String, ByVal lpDirectory As String, & _
 >  ByVal nShowCmd As Long) As Long
 >
 > Dim bSuccessFull As Boolean
 > On Error Resume Next
 > bSuccessFull = ShellExecute(Me.hwnd, "open", & _
 >  "C:\Program Files\Microsoft Office\Office\MSACCESS.EXE", & _
 >  """C:\Program Files\abc\abc application.mde"" " & _
 >  """/wrkgrp "C:\ABC\ABC Data\Data\abc workgroupinfofile.mdw""", & _
 >  "" ,1) > 32
 >
 > perhaps you have to set the application path into "s, too (as it also
 > contains a space char)
 >
 > Hope this helps,
 >
 > Stefan
 >


Relevant Pages

  • Connecting to Sharepoint Problem
    ... String bstrCurrentFolderUrl, Boolean& pbCanCustomizePages, Boolean& ... pVerGhostedSetupPath, UInt32& pdwPartCount, Object& pvarMetaData, ... pbstrRedirectUrl, Boolean& pbObjectIsList, Guid& pgListId, UInt32& ...
    (microsoft.public.biztalk.general)
  • Re: Connecting to Sharepoint Problem
    ... String bstrCurrentFolderUrl, Boolean& pbCanCustomizePages, Boolean& ... pVerGhostedSetupPath, UInt32& pdwPartCount, Object& pvarMetaData, ... pbstrRedirectUrl, Boolean& pbObjectIsList, Guid& pgListId, UInt32& ...
    (microsoft.public.biztalk.general)
  • RE: installation WSS 3.0
    ... <exception, Boolean breakConnection) ... <owningObject, SqlConnectionString connectionOptions, String newPassword, ... <newDatabaseId, String strDatabaseServer, String strDatabaseName, String ... <databaseServer, String databaseName, String databaseUsername, String ...
    (microsoft.public.windows.server.sbs)
  • Die Datei, die Sie zu speichern oder wiederherstellen versuchen, wurde von den Webserveradministrato
    ... bstrUrl, Byte bPageView, Byte bPageMode, Byte bGetBuildDependencySet, ... String bstrCurrentFolderUrl, Boolean& pbCanCustomizePages, Boolean& ... Object& pvarMultipleMeetingDoclibRootFolders, String& ...
    (microsoft.public.de.german.sharepointportalserver)
  • installation WSS 3.0
    ... Boolean redirectedUserInstance) ... identity, SqlConnectionString connectionOptions, Object providerInfo, String ... strDatabaseServer, String strDatabaseName, String strDatabaseUsername, String ... databaseServer, String databaseName, String databaseUsername, String ...
    (microsoft.public.windows.server.sbs)