Link to file on srv,open in orig state readwrite

Anything VBScript-related, including Windows Script Host, WMI, ADSI, and more.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Locked
User avatar
ismailc
Posts: 37
Joined: Mon Nov 09, 2009 6:11 pm

Link to file on srv,open in orig state readwrite

Post by ismailc »

Good day, I desperately need to get the following working.

I have an application that uses vbscripting as it's code developing, The two problems I have is:

1. Creating a link to open the attached file which lies on the server in it's original state.

Code: Select all

fileString = "<a href='upload/test.doc' target=''> View File </a>"
The problem is this open's the doc in a web page and not in Microsoft Word. I need it to open the files in its state being Word,Excel etc.

2. When opening the file in its original State the file must be readwrite. The user must be able to edit & save the file on the server. so the user can make the changes & just click save.

Please help - i need to get it going :(

jvierra
Posts: 14552
Joined: Tue May 22, 2007 9:57 am
Contact:

Link to file on srv,open in orig state readwrite

Post by jvierra »

Let's bedin with the code. It's not VBScript it is HTML. If server side then you cannot do what you want die to security restrictions on Word documents.

YOu can only make the file editable if you save a copy locally.

To produce editable Office files that are based on a server look into SharePoint Server. There are some extenions to Office 2007 that can allow remote editing.

To pursue this with a web solution you should probably seek a forum for web development or Office development.

If, on the other hand, you are looking for a simple solotu9on that uses VBScript you need to post either your code or your full requirements so someone here can help you determine how to proceed with a scripted solution.


jvierra
Posts: 14552
Joined: Tue May 22, 2007 9:57 am
Contact:

Link to file on srv,open in orig state readwrite

Post by jvierra »

Here is a similar solution with an HTML/HTML file.
Save as wtest.htm to web server and run.

YOu will be prompted to OPen/Save as before.

Code: Select all

<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>My HTML Application</title>
<script language="vbscript">
<!-- Insert code, subroutines, and functions here -->
</script>
</head>
<body>
<!-- HTML goes here -->
<a href="test.doc">Open</a>
</body>
</html>

User avatar
ismailc
Posts: 37
Joined: Mon Nov 09, 2009 6:11 pm

Link to file on srv,open in orig state readwrite

Post by ismailc »

Thank You for taking time helping me.

The application uses aspx pages which creates the objects.
I have test server and only have control of the code behind the objects.
eg. label
fileString = "<a href='upload/test.doc' target=''> View File </a>"
fclabel = fileString

Is there maybe another way, where i can call an external program to open the files in it's mode in a seperate window via the vbscript window code?

Please Assist

jvierra
Posts: 14552
Joined: Tue May 22, 2007 9:57 am
Contact:

Link to file on srv,open in orig state readwrite

Post by jvierra »

The code posted will work exactly the same way in ASPX.

You cannot use aspx to directly open a DOC file. There is no way toRun MSWord remotely from a web server. YOu canot call an EXE from a web page on the client side. You can only "GET" the file from the server and let Windows decide what to do with it. THe user will ALWAYS be asked to confirm.

This is built in anti-hacker security to prevent malware from running a program from a web site.

For ASPX you need to use a web delvelopment forum as this forum is mostly about administrative scripting. YOu question is really about web development.

Sorry you cannot do what you want.

There are third party web controls for ASP.NET that can alow limited editing of Office documents in a web page. Check an ASP.NET web forum for help with this.
http://www.asp.net/



jvierra
Posts: 14552
Joined: Tue May 22, 2007 9:57 am
Contact:

Link to file on srv,open in orig state readwrite

Post by jvierra »

You are welcome.



Locked