Get URL...

B

- B@rney

Hi Guys'n Dolls!

Does anyone know if it's possible to, from a C# Add-In in Word, Excel and
PowerPoint, to get the URL from which the current file was opened?

Maybe via the URL in Temporary Internet Files?

I'm building a web based CRM system with a Add-In on the client...
 
P

Peter Huang [MSFT]

Hi B@rney,

Based on my research, I think you may try to use the Path property of the
workbook instance.

Here is a VBA code for your reference, but the Addin will do the same
because they leverage the same Excel Object Modal.
I test when I open the excel file from a WSS site.
Sub Test()
MsgBox ThisWorkbook.Path
End Sub


Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
B

- B@rney

Hi Peter!

Thanks for looking into my posts, I've been eagerly anticipaiting your
response...

Appearantly WSS sites are special. Because in my case (which isn't related
to SharePoint) the Wb.Path returns the path to the temporary internet files
folder, not the URL the document was downloaded from.
 
P

Peter Huang [MSFT]

Hi Brney,

I think for your scenario, it seems that when you click the link to an
excel in a common website, what the IE did is downloaded the file to the
internet cache folder and the lauched the Excel application to open the
file. In this way, the Excel application have no way to know the path.
Because at Excel application side, the Excel Application just open a file
from hard disk just as we open an xls file from C:\.

For the WSS site, it has its internal implement to integrate with Office
product which is not public.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top