Thread View: microsoft.public.office.developer.automation
1 messages
1 total messages
Started by xero
Tue, 31 Dec 2002 00:23
Creating Header/Footer w/ ASP->Word? [MIME Type Change Style]
Author: xero
Date: Tue, 31 Dec 2002 00:23
Date: Tue, 31 Dec 2002 00:23
52 lines
2589 bytes
2589 bytes
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>
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads