When the button is clicked, I want the file (it's a XPS document) to be opened in windows.
The file will be in the same directory as the visual basic project.
Therefore, I need the code to open the file using "app.Path".
Here's the [MSDN article on the Shell Function](http://msdn.microsoft.com/en-us/library/aa242087%28v=VS.60%29.aspx). Which should do what you want. basically Shell(""path""), and yes the double quotes are on purpose. :) If I remember correctly the App object applies to the vb project and the path property is read-only and poins to the directory that the project or .exe is sitting. As long as you have .xps associated with a program in windows then Shell should work.
in order to execute your task , you can use the following:-
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
Const SW_SHOW = 5
And Finally call the function in following way :-
Private Sub Command1_Click()
Dim Filename, MyPath As String
Filename = "test.xps"
MyPath = App.Path & "\" & Filename
ShellExecute hwnd, "open", MyPath, vbNullString, App.Path, SW_SHOW
I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...
Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...