Click here to Skip to main content
15,885,216 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
VB
Case ("3. Surat Tugas")
Dim path As String = System.IO.Path.GetDirectoryName(Application.ExecutablePath) & "\LETTER\SURAT TUGAS.docx\"
System.Diagnostics.Process.Start("explorer.exe", path)



hi all, this is code what i've done before, it's works fine if the program installed on my local computer, but when i decide to share the program folder and map it to another drive, it not show the word file directly, any suggestion ?

thanks before
Posted
Comments
[no name] 28-Jul-15 7:38am    
Use a file browse dialog and allow the user to select the file from there.

1 solution

For starters, don't store files you are going to pass to a word processor in your application folder.

In production, the app folder is part of "Program files" which is restricted access (and generally read only) to prevent virus activity, and that may be causing some of your problem.
Instead, copy the file to a "writable" folder, and open it from there. This may help: Where should I store my data?[^]

If you are trying to do this in a web environment (and the "VB.NET" tag implies this) then you can't do it at all. In development, it works: because the client and server are the same computer. In production, this opens a new process on the server, not the client and the user can't see it at all! (The web host admin can though - and he is unlikely to be amused...)
 
Share this answer
 
Comments
Akbar Giffary 28-Jul-15 20:57pm    
Ok thanks for the advise sir

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900