Article View: comp.sys.mac.apps
Article #2394Re: MS Word: Can file name be in header?
From: Robert Cohen
Date: Thu, 03 Sep 1992 07:16
Date: Thu, 03 Sep 1992 07:16
57 lines
2627 bytes
2627 bytes
In article <1992Sep3.002036.29432@riscsm.scripps.edu> you write:
: Title says it all: is there a way to set up a document
: in MS Word so that the name of the file automatically
: appears in header or footer?
Thomas,
I haven't tested this under Word 5.0 yet, but it worked okay in 4.0.
Hope this helps.
Robert Cohen
Document name hack for Microsoft Word 4.0 and LaserWriter 6.0
Walter Smith, 20 June 1990
This information is hereby placed in the public domain.
The name will appear where the paragraph following the PostScript code appears.
That paragraph should take up enough space for the jobname to fit mainly, you
should make sure the paragraph is tall enough for the font you've chosen.
The document name is derived from the jobname, which is of the form username;
Document: documentname. We search for the rightmost colon in the jobname and
print everything to the right of it.
.para.
initclip
% Change the font of the document name below (this is for Helvetica 12)
/Helvetica findfont 12 scalefont setfont
0 0 moveto
statusdict /jobname get /$jn exch def
$jn length 1 sub -1 0 {
dup $jn exch get 58 eq
{ 1 add $jn exch dup $jn length exch sub getinterval show exit } if
0 eq { $jn show } if
} for
The document name should appear above this paragraph when you print.
In the footer, we use the .pic. command instead of .para., so the name will go
into the first graphic block in the paragraph following the PostScript code.
This allows arbitrary placement, and is good for footers and such. Select Show
Paragraphs to see the empty graphic block.
--
---------------------------------------------------------------------------
Robert Cohen rhcohen@netcom.com <- preferred
rhcohen@PacBell.COM
tel.415.553.4033
---------------------------------------------------------------------------
--
---------------------------------------------------------------------------
Robert Cohen rhcohen@netcom.com <- preferred
rhcohen@PacBell.COM
tel.415.553.4033
---------------------------------------------------------------------------
Technical Details
Message-ID:
<cclnh6c.rhcohen@netcom.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!decwrl!csus.edu!netcom.com!rhcohenReferences:
<1992Sep3.002036.29432@riscsm.scripps.edu>Show Full Headers
Complete Article Headers
Newsgroups: comp.sys.mac.apps Path: arc1-ca.pugleaf.net!sparky!uunet!decwrl!csus.edu!netcom.com!rhcohen From: rhcohen@netcom.com (Robert Cohen) Subject: Re: MS Word: Can file name be in header? Message-ID: <cclnh6c.rhcohen@netcom.com> Date: Thu, 03 Sep 92 07:16:46 GMT Organization: Netcom - California Home for the Over-Stimulated References: <1992Sep3.002036.29432@riscsm.scripps.edu> X-Newsreader: Tin 1.1 PL4 Lines: 57