Advertise with us
Control Panel
Forum
Hosting Help
ASP.NET 4.5 & SQL 2012 Hosting
Resources
Notice
Login
Members
Shared Hosting
|
Upgrade
|
Advertise
|
Tutorials
|
Home
»
Questions & Answers
»
asp.net vbscript passing info to trigger routine
asp.net vbscript passing info to trigger routine
05 May, 12
Author:
mohamed karolia
<script runat=server language=VBScript>
I have a some code which creates a word document, thats great.
My problem is
How do I send information to it from a web form,
Once received I know I can manipulate the data with the code below, but how do I get it there,
I someone can make a textbox with a button that triggers the code below, that would be great,
I'm new to coding so any help is appreciated
Thanks
sub generatemsdoc()
dim strbody as string
strbody = <html><body><div>Your name is: <b> & input variable & </b></div><table width='100%' style='background-color:#cfcfcf;'><tr><td>1st Cell body data</td><td>2nd cell body data</td></tr></table>Ms Word document generated successfully.</body></html>
Response.AddHeader(Content-Disposition, attachment; filename = wordfile.doc)
Response.Charset = UTF-8
Response.ContentType = application/msword
Response.Write(strbody)
end sub
</script>
Answers .............
Author:
inder Singh
Posted Date: 05 May, 12
can you explain your question in more detail ?
Author:
mohamed karolia
Posted Date: 05 May, 12
the above code creates a word document on the fly
see it in action
http://aspspider.info/cvbuilder/cv.aspx
I
want to be able to send variables to it eg name address etc from a webform so that I can place them in msword doc automatically.
I can manipulate the strbody
but how to I get name address etc from a webform to that part of the code
Thanks
Author:
inder Singh
Posted Date: 05 May, 12
I think you should create a form for the input text in order to store them in the word document.
Thanks
Author:
Alexander Chavers
Posted Date: 17 May, 12
<form runat=server'>
<asp:TextBox id='txtBox1'></asp>
<asp:Button id='btn1'></asp>
</form>
You can have the button call your sub procedure and use
txtBox1.Value as the variable.
Author:
Nishanth Mohan
Posted Date: 17 May, 12
Please visit
http://aspspider.info/smsmallu
/
You must
login
to post answer for this question.
Total
members
:
250839
Average new registrations per day (in last 7 days):
10
New Registration:
Open
Register Now
Talk to Webmaster
Tony John
Facebook
Google+
Twitter
Advertise
Privacy Policy
Terms of use
Contact Us
SpiderWorks Technologies Pvt Ltd.
All Rights Reserved.