ASP to MS Word!

This is a discussion on "ASP to MS Word!" within the Classic ASP section. This forum, and the thread "ASP to MS Word! are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > Classic ASP

Notices


Closed Thread
 
LinkBack Thread Tools
  #1 (permalink)  
Old Sep 24th, 2004, 04:34
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,608
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Send a message via Yahoo to Monie
ASP to MS Word!

Is it posible that i can send a specific recordset from my asp form to the ms word word processor?

Can any body teach me how?
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)

  #2 (permalink)  
Old Sep 24th, 2004, 12:08
Junior Member
Join Date: Oct 2003
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Hi Monie,

I may be totally way off here but it may be worth a go. I don't do asp but jsp and php so I can't tell you the syntax. Never tried this before so you could be my lil' guinea-pig here :wink:.

Have you tried writing your data to a .doc in the same way you would to a .txt file?

I'm sure Rob will get back to you with a more appropriate and explanative way of doing this, as soon as he's finished doing his nails . Hang tight, I'm sure they're almost dry. lol.
  #3 (permalink)  
Old Sep 24th, 2004, 12:19
Rob's Avatar
Rob Rob is offline
Head Admin & CEO

SuperMember
Join Date: Jul 2003
Location: at my desk
Age: 34
Posts: 2,952
Blog Entries: 7
Thanks: 7
Thanked 4 Times in 4 Posts
Send a message via MSN to Rob Send a message via Skype™ to Rob
Hi monie.... My nails are dry now, so here you go:-

http://www.serverwatch.com/tutorials...le.php/1493361

This should help you in what you are trying to do.

If you get stuck, post back here so I can help you further.
:wink:
__________________
Rob - SEO Specialist
Owner & Founder of Webforumz.com

I am currently unavailable for private work
  #4 (permalink)  
Old Sep 29th, 2004, 10:05
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,608
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Send a message via Yahoo to Monie
Hai rob,
Well, actually thats not what i want to do

Ok...
I have a Search Page in asp that will search something in my database and displays it in my Display page

In this Display page, there will be a button(generate report)! When the user click it, all the result that is currently displayed in the Display page will be transfer or coppied to microsoft word page!

I just can print it out from the asp page by providing the javascript print function...but i wantet to try new ways of doing this things

Can you help me
Thanx Rob.
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
  #5 (permalink)  
Old Sep 29th, 2004, 10:18
Rob's Avatar
Rob Rob is offline
Head Admin & CEO

SuperMember
Join Date: Jul 2003
Location: at my desk
Age: 34
Posts: 2,952
Blog Entries: 7
Thanks: 7
Thanked 4 Times in 4 Posts
Send a message via MSN to Rob Send a message via Skype™ to Rob
monie...

After hearing exactly what you are trying to do, I'll refer you again back to the link I gave you above.

It is what you are looking for. You will have to fire information at the MS word page, in exactly the same way explained at that link above.

Sorry if my advice does not seem helpful to you, but I suggest you go back to the link above and use that method. If you get stuck with it, come back to this thread.
__________________
Rob - SEO Specialist
Owner & Founder of Webforumz.com

I am currently unavailable for private work
  #6 (permalink)  
Old Sep 29th, 2004, 10:30
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,608
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Send a message via Yahoo to Monie
Actually i dont really understand what to do from that link that you gave me
It's very complicated...

can you teach me how to do it instead, please
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
  #7 (permalink)  
Old Sep 29th, 2004, 10:41
Rob's Avatar
Rob Rob is offline
Head Admin & CEO

SuperMember
Join Date: Jul 2003
Location: at my desk
Age: 34
Posts: 2,952
Blog Entries: 7
Thanks: 7
Thanked 4 Times in 4 Posts
Send a message via MSN to Rob Send a message via Skype™ to Rob
Basically Monie, make a copy of the DISPLAY page you have that brings you the results.... rename it to WordPage.asp.... or something.

Now, instead of writing the results like it were a webpage, send the content to the MS word document in the manner described in the resource I pointed you to.

Hope that makes sense.
__________________
Rob - SEO Specialist
Owner & Founder of Webforumz.com

I am currently unavailable for private work
  #8 (permalink)  
Old Sep 29th, 2004, 10:59
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,608
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Send a message via Yahoo to Monie
ok...
Where should i put the code?
does it send everything in my display to ms word?
how does the ms word opens, by button?

can i post my code to you?
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
  #9 (permalink)  
Old Sep 29th, 2004, 11:05
Rob's Avatar
Rob Rob is offline
Head Admin & CEO

SuperMember
Join Date: Jul 2003
Location: at my desk
Age: 34
Posts: 2,952
Blog Entries: 7
Thanks: 7
Thanked 4 Times in 4 Posts
Send a message via MSN to Rob Send a message via Skype™ to Rob
Hi Monie.... post your display code in this thread, and I'll see what I can do. bear with me though... the next 2 days are pretty hectic for me.
__________________
Rob - SEO Specialist
Owner & Founder of Webforumz.com

I am currently unavailable for private work
  #10 (permalink)  
Old Sep 29th, 2004, 11:15
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,608
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Send a message via Yahoo to Monie
This is my display page which displays three things that is: User Name, User Comment and the comment date.

Code: Select all
<%@LANGUAGE="VBSCRIPT"%> 

<%
set allComment = Server.CreateObject("ADODB.Recordset")
allComment.ActiveConnection = MM_userComment_STRING
allComment.Source = "SELECT * FROM userCommentDecending"
allComment.CursorType = 0
allComment.CursorLocation = 2
allComment.LockType = 3
allComment.Open()
allComment_numRows = 0
%>
<%
Dim Repeat1__numRows
Repeat1__numRows = -1
Dim Repeat1__index
Repeat1__index = 0
allComment_numRows = allComment_numRows + Repeat1__numRows
%>
<html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Main Page</title>
<style type="text/css">
<!--
A:link { COLOR: #164376; TEXT-DECORATION: none}
A:visited {COLOR: #164376; TEXT-DECORATION: none}
A:active { COLOR: #164376; TEXT-DECORATION: none}
A:hover { COLOR: #000000; TEXT-DECORATION: none}
-->
</style>
</head>
<body bgcolor="#CEDFED" topmargin="0">
<FORM NAME="frmSenarai">


 	<table border="1" cellspacing="1" width="100%" id="AutoNumber3" bordercolor="#0D5692" bordercolorlight="#000000" bordercolordark="#000000" bgcolor="#587698" height="4" style="border-collapse: collapse">
        <tr> 
          <td width="50%" bgcolor="#587698" bordercolor="#000000" height="18" bordercolorlight="#587698" bordercolordark="#587698"> 
            <font size="1" face="Verdana" color="#FFFFFF">Main Page > View 
            All User Comment</font></td>
          <td width="50%" bgcolor="#587698" bordercolor="#000000" height="18" bordercolorlight="#587698" bordercolordark="#587698"> 
            <p align="right"> <font face="Verdana" size="1" color="#FFFFFF">[<%=FormatDateTime(Date,1)%> | Time: ]</font></td>
        </tr>
      </table>
  

  <table border="1" cellspacing="1" width="100%" id="AutoNumber3" bordercolor="#0D5692" bordercolorlight="#000000" bordercolordark="#000000" bgcolor="#164376" style="border-collapse: collapse">
    <tr> 
      <td width="100%" bgcolor="#164376" bordercolor="#000000" height="18" bordercolorlight="#000000" bordercolordark="#587698"> 
        <p align="center"><font face="Verdana" size="2" color="#FFFFFF">User 
          Comment</font> 
      </td>
    </tr>
  </table>
  <div align="right"> <font face="Verdana" size="2"> [Back] 
    </font> </div>
  <table border="1" width="100%" id="AutoNumber4" bordercolorlight="#E1E1E1" bordercolordark="#E1E1E1">
    <tr> 
      <td width="17%" bgcolor="#587698" bordercolorlight="#000000" bordercolordark="#000000" align="center" height="16"> 
        <font face="Verdana" size="2" color="#FFFFFF">User Name</font></td>
      <td width="21%" bgcolor="#587698" bordercolorlight="#000000" bordercolordark="#000000" align="center" height="16"> 
        <font face="Verdana" size="2" color="#FFFFFF">Date Commented</font></td>
      <td width="54%" bgcolor="#587698" bordercolorlight="#000000" bordercolordark="#000000" align="center" height="16"> 
        <font face="Verdana" size="2" color="#FFFFFF">Comment</font></td>
      <td width="8%" bgcolor="#587698" bordercolorlight="#000000" bordercolordark="#000000" align="center" height="16"><font color="#FFFFFF" size="2" face="Verdana, Arial, Helvetica, sans-serif">Delete?</font></td>
    </tr>
    <% 
While ((Repeat1__numRows <> 0) AND (NOT allComment.EOF)) 
%>
    <tr> 
      <td width="17%" bordercolorlight="#587698" bordercolordark="#587698" bgcolor="#F1F1F1" height="8" valign="top"> 
        <div align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><%=(allComment.Fields.Item("cName").Value)%></font></div>
      </td>
      <td width="21%" bordercolorlight="#587698" bordercolordark="#587698" bgcolor="#E1E1E1" height="8" valign="top"> 
        <div align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><%=(allComment.Fields.Item("cDate").Value)%></font></div>
      </td>
      <td width="54%" bordercolorlight="#587698" bordercolordark="#587698" bgcolor="#F1F1F1" height="8" valign="top"> 
        <div align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><font color="#003366"><%=(allComment.Fields.Item("cComment").Value)%></font></font></div>
      </td>
      <td width="8%" bordercolorlight="#587698" bordercolordark="#587698" bgcolor="#F1F1F1" height="8" valign="middle"> 
        <div align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Delete</font></div>
      </td>
    </tr>
    <% 
  Repeat1__index=Repeat1__index+1
  Repeat1__numRows=Repeat1__numRows-1
  allComment.MoveNext()
Wend
%>
  </table>
  <div align="center"> 

  </div>
</FORM>
</body>
</html>
<%
allComment.Close()
%>
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
  #11 (permalink)  
Old Sep 29th, 2004, 11:39
Rob's Avatar
Rob Rob is offline
Head Admin & CEO

SuperMember
Join Date: Jul 2003
Location: at my desk
Age: 34
Posts: 2,952
Blog Entries: 7
Thanks: 7
Thanked 4 Times in 4 Posts
Send a message via MSN to Rob Send a message via Skype™ to Rob
I'll help you, but for the life of me, I cant see the benefit of sending this to a word document.
__________________
Rob - SEO Specialist
Owner & Founder of Webforumz.com

I am currently unavailable for private work
  #12 (permalink)  
Old Sep 29th, 2004, 11:44
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,608
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Send a message via Yahoo to Monie
I just want to get the idea...
If i know how to code it, i can use it in my real page.

Sorry, this is the only page that available to me right now
All my files is in my home

So..can you show me step by step Rob?
Please...i'll wait for your reply
Thanx again..
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
  #13 (permalink)  
Old Sep 29th, 2004, 14:02
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,608
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Send a message via Yahoo to Monie
Hai Rob...
So did you manage to go through my code
I really need your help on this...
Please..
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
  #14 (permalink)  
Old Sep 29th, 2004, 14:16
Rob's Avatar
Rob Rob is offline
Head Admin & CEO

SuperMember
Join Date: Jul 2003
Location: at my desk
Age: 34
Posts: 2,952
Blog Entries: 7
Thanks: 7
Thanked 4 Times in 4 Posts
Send a message via MSN to Rob Send a message via Skype™ to Rob
Can I ask you to bear with me? I have already said the next few days are hectic.

Please be patient monie.
__________________
Rob - SEO Specialist
Owner & Founder of Webforumz.com

I am currently unavailable for private work
  #15 (permalink)  
Old Sep 30th, 2004, 01:34
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,608
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Send a message via Yahoo to Monie
Ok Rob...
I'll wait for ya!
Thanx anywhere, for helping me!

I have gone through the link site that you gave me but still I dont understand!

Good luck with your "hetic day"
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
  #16 (permalink)  
Old Oct 4th, 2004, 04:44
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,608
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Send a message via Yahoo to Monie
Hai Rob...
I have tried to use this code on the top of my page but when the page load, it will directly ask the user to save the page or not.

What i want to do is to open ms word with a button!
so...hows your hetic day going on

Code: Select all
<%
    Response.ContentType = "application/msword"
    Response.AddHeader "Content-Disposition","attachment;filename=filename.doc"
    %>
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
  #17 (permalink)  
Old Oct 12th, 2004, 02:46
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,608
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Send a message via Yahoo to Monie
<font size="2"><span style="font-family:Verdana">Hai Rob...
I have found a simple solution for the ASP TO WORD problem!
Check this out: ASP TO WORD

It almost the same as your approach: YOUR ASP TO WORD, but this approach: MY ASP TO WORD,
is more easier to be understand especially me.

Actually there is a bit difference between the code,
Your method will ask the user to save the page as word!
The method that I found will open a word inside a browser...
The user can edit the page in word before saving them as .doc page!

</span id="Verdana"></font id="size2">
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
  #18 (permalink)  
Old Oct 12th, 2004, 09:41
Rob's Avatar
Rob Rob is offline
Head Admin & CEO

SuperMember
Join Date: Jul 2003
Location: at my desk
Age: 34
Posts: 2,952
Blog Entries: 7
Thanks: 7
Thanked 4 Times in 4 Posts
Send a message via MSN to Rob Send a message via Skype™ to Rob
I'm glad you found a solution.... although I am still puzzled by why you needed to do this.

Maybe now you have solved this monie, you could write a tutorial for others to follow?
__________________
Rob - SEO Specialist
Owner & Founder of Webforumz.com

I am currently unavailable for private work
Closed Thread

Tags
asp, word

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
The F word... Abby Webforumz Cafe 14 Jun 23rd, 2008 14:29
Word Wiz dangergeek Free Web Site Critique 11 Dec 20th, 2007 23:44
can i add word document? monstermunch Starting Out 8 Apr 20th, 2007 16:49
The best word ever!!! refraction Webforumz Cafe 11 Mar 2nd, 2007 02:54
Word up... kennyfix Introduce Yourself 4 Aug 1st, 2005 20:42


All times are GMT. The time now is 00:05.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43