PDA

View Full Version : XPS File



Marlieke
01-24-2011, 05:08 AM
Hello all,

I have built an Access database. Some reports are send to users as .XPS files. This all works.

But now they want to see the send XPS files as a history from Access. So I want to open the XPS viewer with the choosen XPS file by using the database I built already.

Can someone help me how I open with VBA code the XPS viewer with the choosen file. I can locate and select the file, I only want to know the code to open the Viewer.

Thank you

Marlieke

orange
01-30-2011, 06:26 PM
I found this link
http://office.microsoft.com/en-us/onenote-help/save-a-file-in-xps-format-HA010064993.aspx

There is mention of a Free Viewer within the file.

Hope it's useful to you.

L@ja
01-31-2011, 08:47 AM
Hi,
maybe this ok for you:

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

sub myshell(what as string)
ret=ShellExecute(0&, vbNullString, what, vbNullString, vbNullString, vbNormalFocus)
end sub


regards