/ Forside / Teknologi / Udvikling / ASP / Nyhedsindlæg
Login
Glemt dit kodeord?
Brugernavn

Kodeord


Reklame
Top 10 brugere
ASP
#NavnPoint
smorch 9259
Harlekin 1866
molokyle 1040
Steffanst.. 758
gandalf 657
smilly 564
gibson 560
cumano 530
MouseKeep.. 480
10  Random 410
Creating Header/Footer w/ ASP->Word? [MIME~
Fra : xero


Dato : 31-12-02 01:23

I know how to get ASP to send a Word file to the client (via changing
the MIME type).

Change ContentType, print out basic HTML page, Word autoformats. Yay.

Here's the trick, I'd like to be able to add a page header across all
pages to this dynamic Word document.

Any idea how?

xero (Jason McDonald)
xero@xerotopia.net


My Thoughts:
I thought maybe I could add some VBScript or something and Word would
treat it as a Macro, but my experiments didn't turn out so well.
e.g.:
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
Selection.TypeText Text:="My Header"

Is there anyway to add an autoexecuting macro or just simply add the
headers via a DIV or something?


Sample Code for creating Word doc from ASP/HTML:
<%@ Language=VBScript %>
<%
Response.ContentType ="Application/vnd.ms-word"
Response.AddHeader "Content-Disposition","inline;filename=myWord.doc"

Dim i
%>
<TABLE name="tbl" id="tbl">
<TR>
<TH>Col 1</TH>
<TH>Col 2</TH>
<TH>Total</TH>
</TR>
<% For i = 0 To 50 %>
<TR>
<TD>1</TD>
<TD>2</TD>
<TD><FONT color="#000080">3</FONT></TD>
</TR>
<TR>
<TD>4</TD>
<TD>6</TD>
<TD><FONT color="#000080">10</FONT></TD>
</TR>
<% Next %>
</TABLE>

 
 
Søg
Reklame
Statistik
Spørgsmål : 177560
Tips : 31968
Nyheder : 719565
Indlæg : 6408946
Brugere : 218888

Månedens bedste
Årets bedste
Sidste års bedste