From: carter@cemvax.cem.msu.edu (Tom Carter)
Newsgroups: comp.os.ms-windows.apps,comp.os.ms-windows.misc
Subject: re: Help: WfW: Big character on 1st character of 1st paragraph.
Date: 3 Sep 92 17:09:15 GMT
Organization: Michigan State University, East Lansing Michigan

In article <1992Sep2.070641.11215@usage.csd.unsw.OZ.AU> raymond@vast.unsw.edu.au (Raymond Leung) writes:
>What is the best way of making the first alphabet of the very first
>paragraph big in WfW as in:
>
>----- his article is about...
>  |   .......................
>  |   .......................
>  |   .......................
>  |   .......................
>..............................
>..............................
>
>I tried to use frame, but the character is not really at the top left edge
>of the column.  The top of the big character is somewhere between the 1st
>and 2nd line and it requires some patient to put it at the right place. 
>I already turned the space around the frame to 0, left justified the
>frame and paragraph etc.
>
>Any ideas?
>
>
>Raymond Leung
>VLSI and System Technology Laboratory,
>School of Computer Science and Engineering,
>The University of New South Wales.

Here's a Word Basic macro for this called DropCap:

=========Cut here ==============
Sub MAIN
If SelInfo(27) Then
	MsgBox "Command not available in a macro window"
	Goto bye
End If

If InStr(WindowName$(), "NEWMACRO.DOC") <> 0 Then
	ToolsMacro .Name = "AutoClear", .Show = 2, .Run
	InsertPara : InsertPara : InsertPara : InsertPara
	Insert "Example Text"
End If

ViewPage
msg$ = "There is a drop cap in this paragraph already.  Do you still want to continue?"
InsertBookmark .Name = "starthere"
REM find the first letter in paragraph and check for drop cap
EditGoTo "\para"
EditGoTo "\startofsel"
If CmpBookmarks("\sel", "\startofdoc") = 0 Then ffirstpara = 1
REM check if first char is a dropcap
CharRight 1, 1
If fcheckcap = 1 Then
	If MsgBox(msg$, 5) = 0 Then Goto restore
End If
REM check if prev para is a drop cap
If Not(ffirstpara) Then
	CharLeft 2
	CharLeft 1, 1
	If fcheckcap = 1 Then
		If MsgBox(msg$, 5) = 0 Then Goto restore
	End If
End If
EditGoTo "starthere"

REM set fontsize
sizecur = FontSize()
fontstyle$ = Font$()
If sizecur <= 8 Then
	If fontstyle$ = "Courier" Then
		sizecap = 48
	Else
		sizecap = 38
	End If
	charSuperscript = 5
ElseIf sizecur <= 10 Then
	If fontstyle$ = "Courier" Then
		sizecap = 56
	Else
		sizecap = 48
	End If
	charSuperscript = 8
ElseIf sizecur <= 12 Then
	If fontstyle$ = "Courier" Then
		sizecap = 56
		charSuperscript = 8
	Else
		sizecap = 54
		charSuperscript = 10
	End If
ElseIf sizecur <= 14 Then
	If fontstyle$ = "Courier" Then
		sizecap = 70
		charSuperscript = 12
	ElseIf fontstyle$ = "Helvetica" Then
		sizecap = 70
		charSuperscript = 13
	Else
		sizecap = 64
		charSuperscript = 12
	End If
End If

REM check for line spacing
REM can't get current value of formatparagraph
Dim dlg As FormatParagraph
GetCurValues dlg
If InStr(dlg.LineSpacing, "1.5 li") = 1 Then
	sizecap = sizecap * 1.33
ElseIf InStr(dlg.LineSpacing, "2 li") = 1 Or InStr(dlg.LineSpacing, "Double") = 1 Then
	sizecap = sizecap * 0.177
End If
frameWidth$ = Str$(sizecap / 72) + Chr$(34)
frameHeight$ = frameWidth$
sizecap$ = Str$(sizecap)

REM Insert Text
REM assuming the current paragraph is the right one
EditGoTo "\para"
EditGoTo "\StartofSel"
CharRight 1, 1
userchar$ = Selection$()
InsertFrame
FormatFrame .Wrap = 1, .WidthRule = 1, .FixedWidth = frameWidth$, .HeightRule = 2, \
FixedHeight = frameHeight$, .PositionHorz = "Left", .PositionHorzRel = 0, \
DistFromText = "0" + Chr$(34), .PositionVert = 0, \
PositionVertRel = 2, .DistFromText = "0" + Chr$(34)
FormatParagraph .Alignment = 1
FormatCharacter .Position = Str$(charSuperscript), .Points = sizecap$
EditGoTo "\startofsel"
restore:
EditGoTo .Destination = "starthere"
REM insertbookmark .name "starthere", .delete
bye:
End Sub

Function fcheckcap
REM this sub checks to see if there has already been a dropped cap in the current paragraph
Dim dlg As FormatParagraph, dlg_1 As FormatBorder
GetCurValues dlg : GetCurValues dlg_1
If dlg.Alignment = 1 Then
	Redim dlg As FormatCharacter
	GetCurValues dlg
	If Int(Val(dlg.Position)) >= 5 Then
		fcheckcap = 1
	End If
Else
	fcheckcap = 0
End If
End Function
=============Cut here============

to install in W4W 2.0x:
	-open a word document and import the contents of the macro above
	-copy everything in it to the clipboard
	-choose Options Macro
	-in the Macro name box type DropCap
	-choose edit
	-delete the "Sub MAIN" and "End Sub" lines so the window is empty
	-paste the clipboard contents into the macro window
	-choose File Close
	-answer "yes" to the prompt "Do you want to save the changes to..."

Now you're ready to use it:
	-Put the cursor anywhere in the paragraph to get the dropped capital
	-choose Options Macro and select DropCap
	-Press Run
and Presto, you're done! Small changes in the size of the frame, its position, 
and the point size of the large letter often improves the appearance.

Have *Fun*
============================================================================
|         Tom Carter                    |     carter@cemvax.cem.msu.edu    |
|   Michigan State University           |     carter@msucem.bitnet         |
|     Chemistry Department              |                                  |
============================================================================