Solved

Please convert this to JSP

Posted on 2003-12-08
10
289 Views
Last Modified: 2010-04-01
Hi All,

Could someone please convert the following VBScript/ASP code to JavaScript/JSP:
<%

...

<script language=vbscript>
Sub SendToWord
      dim Obj , tObj , st2
      set tObj = createobject("Word.Application")
      tObj.Visible = True
      Set Obj = tObj.WordBasic
      st2 = document.all.item("wordtext").innerTEXT
      Obj.FileNew
      Obj.appmaximize 1
      'obj.centerpara
      obj.fontsize 8
      obj.font  "Courier New"
      obj.insert st2
      obj.font "Courier New"
End Sub
</script>


<script language=vbscript>
            call SendToWord()
</script>

...

%>

TIA
DoughBoy
0
Comment
Question by:DoughBoy
  • 6
  • 4
10 Comments
 
LVL 14

Expert Comment

by:kennethxu
ID: 9900221
This is going to be a project :-)
0
 
LVL 14

Expert Comment

by:kennethxu
ID: 9900239
hold on, a closer look seems this is client side vbscript. jsp is server side programming. you cannot convert this kid of vbscript to jsp. but you can still use it in jsp page, isn't it? what's your problem?
0
 

Author Comment

by:DoughBoy
ID: 9901699
well, my goal is to have a jsp page open MS Word and send some text to it.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:DoughBoy
ID: 9901712
Maybe Microsoft really does have better tools and languages than the others?
(ASP)
0
 
LVL 14

Expert Comment

by:kennethxu
ID: 9901747
>> well, my goal is to have a jsp page open MS Word and send some text to it.
this is client side thing, it is nothing to do with jsp. your vbscript should continue to work as long as you convert rest of asp to the jsp.
0
 

Author Comment

by:DoughBoy
ID: 9904695
Can VBScript be rendered from a Linux Server?
How would the code look if it was converted to JavaScript?
0
 
LVL 14

Accepted Solution

by:
kennethxu earned 100 total points
ID: 9905140
vbscript and javascript are all client side language. the server is not going to render anything, it simple send then to browser as is.

the diff is only IE support vbscript, no other browser does. in terms of the converting vbscript to javascrip, you'll have much better luck in javascript forum.
0
 
LVL 14

Expert Comment

by:kennethxu
ID: 9905208
there is another alternative, you can create a word doc at server side and send the word doc to client using poi:
http://jakarta.apache.org/poi/hwpf/
0
 

Author Comment

by:DoughBoy
ID: 9913754
thanks for your help.
Merry Christmas
0
 
LVL 14

Expert Comment

by:kennethxu
ID: 9913791
thanks for the A grade and Merry Christmas to you too.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enabling the Skype for Business Meeting Scheduler in Hybrid OWA
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question