Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 Open a file

Author  Topic 

swatib
Posting Yak Master

173 Posts

Posted - 2005-12-15 : 05:03:19
Hi All

I have a File Upload control to select a file and want to open that selected file in its editor. how can I do this?

Please help me out

Njoy Life

surendrakalekar
Posting Yak Master

120 Posts

Posted - 2005-12-15 : 05:14:55
There are few API calls to do so. That API may be LOAD para1, para2 .....

Surendra
Go to Top of Page

swatib
Posting Yak Master

173 Posts

Posted - 2005-12-15 : 05:20:00
Can you please clarify ur answer?

Njoy Life
Go to Top of Page

surendrakalekar
Posting Yak Master

120 Posts

Posted - 2005-12-15 : 05:26:40
Download API-GUIDE from the below given link and findout the required API call to load the file.
http://www.mentalis.org/agnet/apiguide.shtml


Surendra
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-12-15 : 06:00:35
Check out some sample codes at
www.codeproject.com
www.asp.net

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

swatib
Posting Yak Master

173 Posts

Posted - 2005-12-16 : 05:35:51
I found following code:

First, you should add the reference "Microsoft Excel Object Library"

Dim xlApp Excel.Application

Dim xlBook As Excel.Workbook


'Create an Excel application object

xlApp = CType(CreateObject("Excel.Application"), Excel.Application)


'Make MS Excel Application visible to the user
'You could make it False, so the Excel file will be opened as hidden

xlApp.Visible = True

'Load your Excel file to a Workbook object

xlBook = xlApp.Workbooks.Open("F:\called.xls")

-----------
This code run successfully but If I give variable that contains the path as parameter in the last statement then not working. What should I do?



Njoy Life
Go to Top of Page

surendrakalekar
Posting Yak Master

120 Posts

Posted - 2005-12-16 : 05:41:24
Whether you want to open only Excel files?
or
all types of files like.. doc, ppt, txt, html, bmp, jpg, pdf, autocad... etc.. etc..

Surendra
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-12-16 : 07:14:31
Try

xlBook = xlApp.Workbooks.Open('" & variable & "')


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -