Hi All,

I've been away for a couple of days so am sorry if I've come in a little
late on this discussion.

I have in fact made use of macros by Fred Pearson for this purpose for some
time.  I did have a zip file which used to be handed out to folk with
various versions of the macros, but anyway, a few months ago Fred posted to
the JAWS (Ausie) list and I'm therefore just going to pass on his post.

Watch out for lines which become truncated in the posting.  In other words,
if things don't work correctly as you follow carefully the various steps,
the likelihood is that some lines are chopped in the wrong places.  (I may
be able to help but don't guarantee it.)

Anyway, Fred's message follows and I hope it works for you:

--
Carol Pearson
[EMAIL PROTECTED]

Reply-To: "Fred Pearson" <[EMAIL PROTECTED]>
From: "Fred Pearson" <[EMAIL PROTECTED]>
To: "JAWS Users" <[EMAIL PROTECTED]>
Subject: SayInches for Word 97
Date: Tue, 5 Jan 1999 10:10:56 -0700
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 4.72.3110.1
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
Sender: [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]

SayInches for Word 97

SayInches says the number of inches or centimeters 
from the left edge of the page.

I wrote the original SayInches in WordBasic
for Word 6 and Word 95 
and the JAWS macro language for JAWS 2.
I would like to thank several of you
who have asked for SayInches
in Word 97 and JAWS 3.2.

Although I have not recently monitored this list closely, 
I suspect that someone has posted a new SayInches.
However, since I am still receiving requests, 
here is a version to test.  
Please let me know if you find it useful, 
or if it needs work.

SayInches could be written and implemented many ways.
The Word macro below is simply converted from WordBasic.
Perhaps someone has written the macro in Visual Basic.

A few keystrokes could be shaved from the steps below,
but the intent is to provide enough detail 
so that even new JAWS and Word users
can implement SayInches.  
If you find the tutorial approach tedious, 
just skip down to the Word macro and JAWS script.  
I'm always interested 
in learning how much description is helpful.

The apostrophe key in SayInches
reminds us of the quote or inches symbol
which is on the same key.


Implementing SayInches

1.
In your email program
select this message
SayInches for Word 97
2.
Activate the Reply command.
(In some programs, press control+r.)
(Do not actually send the message.)
3.
If you decide to tape record this message,
so you can follow the steps more easily,
press insert+DownArrow for SayAll.
4.
In the text below these numbered instructions,
arrow down to the following line
Sub SayInches()
5.
Arrow down one more line.
6.
While holding down the shift key,
arrow down until you hear
End Sub
7.
While holding down the shift key,
arrow up one line.
8.
Press control+c to copy to the clipboard.
9.
Press DownArrow to deselect the text.
10.
Start or switch to Microsoft Word 97.
11.
Press alt+t to open the Tools menu.
12.
Press m to open the Macros submenu.
13.
Press m to open the Macros dialog.
14.
Type the following word:
SayInches
15.
Press Enter to create the macro.
16.
Visual Basic generates an empty macro.
Press control+v to paste the macro body.
17.
Press control+F4 to close the macro window.
18.
Press alt+F4 to close Visual Basic.
Word is now the active window.
19.
Press alt+t to open the Tools menu.
20.
Press c to open the Customize dialog.
21.
Press alt+k to open the Customize Keyboard dialog.
22.
Press m twice to select Macros.
23.
Tab once to the list of macros.
24.
To select, type some or all of the following word:
SayInches
25.
Tab once to the shortcut key field.
26.
Press the following key combination:
control+alt+apostrophe
27.
Press Enter to Assign the key.
28.
Press Enter to Close the Customize Keyboard dialog.
29.
Press Escape to close the Customize dialog.
30.
Press insert+F2 to open the Run JAWS Manager dialog.
31.
Press s to select Script Manager.
32.
Press Enter to open the Script Manager.
33.
Press alt+SpaceBar to open the application control menu.
34.
Press x to maximize the window.
35.
Press control+End to reach the end of file.
36.
Press Enter to create a blank line.
37.
Press alt+s to open the Script menu.
38.
Press n to create a New script.
39.
Type the following word:
SayInches
40.
Tab once to the next control.
41.
Press the SpaceBar to check
Can be attached to key
42.
Tab once to Synopsis.
43.
Type the following:
Say inches from left edge of page
44.
Tab once to Description.
45.
Type the following:
Say inches or centimeters from left
46.
Tab twice to Assign To.
47.
Press the following key combination:
insert+apostrophe
48.
Press Enter to create empty script.
49.
While holding down alt,
tap Tab until you reach this SayInches message.
50.
In the text below these instructions,
arrow down to the following line:
Script SayInches ()
51.
Arrow down one more line.
52.
While holding down the shift key,
arrow down until you hear
EndScript
53.
While holding down the shift key,
arrow up one line.
54.
Press control+c to copy to the clipboard.
55.
Press DownArrow to deselect the text.
56.
If you are ready to close the copy of the email message,
press alt+F4
and if prompted to Save,
answer No.
57.
If necessary,
press alt+tab to switch to the Script Manager.
58.
Press control+v to paste the script body.
59.
Press alt+f to open the File menu.
60.
Press s to Save the script,
and listen for the message
Compile Complete
61.
Optional step, if comfortable:
delete any blank lines in the script
and press control+s to Save.
62.
Press alt+F4 to close the Script Manager.
63.
While holding down alt,
tap Tab until you hear
Microsoft Word
64.
Press insert+apostrophe.
65.
Press insert+apostrophe
and listen for the inches or centimeters.
66.
Move the caret (PC cursor) left or right
and press insert+apostrophe
to hear the inches or centimeters.

Your feedback will be greatly appreciated.  
I cannot read all of the mail on this list, 
so please don't hesitate to contact me privately at  
[EMAIL PROTECTED]

If we need to work on SayInches, 
I know we have plenty of talent on the list.  
I will be eager to help as I can, 
but you are likely to find quick response from others 
who monitor the list on a regular basis.

One general JAWS script tip:
on some systems,
sometimes a Delay or Pause is needed.

Thank you for your interest in SayInches.


The Word macro follows:

Sub SayInches()
' SayInches Macro for Word 97

Dim units
Dim PageDialog As Object
Dim units_$
Dim unit$
Dim twips

'   Say inches or centimeters
'   from left edge of page.
'   Assign to control alt apostrophe.

'   Microsoft Word 97 macro converted from
'   Microsoft Word 95 or Word 6 macro.

'   SayInches (c) 1997, 1998
'   Fred Pearson
'   [EMAIL PROTECTED]

'   SelInfo(5) returns the number
'   of twips left of the selection.
'   1 point = 20 twips
'   1 inch = 72 pt = 1440 twips = 2.54 cm
'   1 centimeter = 566.9291 twips

'   Officially, SelInfo(5) is valid
'   only in Page Layout View,
'   where the margin is included,
'   but by adding units in margin,
'   the Normal view appears to be supported.

'   Only inches and centimeters are
'   supported by this macro.  No check
'   is made for picas or points.

    If WordBasic.ViewPage() Then  ' Page Layout
        units = 0  ' margin included
    Else  ' Normal, Outline, Master Doc
        Set PageDialog = _
            WordBasic.DialogRecord.FilePageSetup(False)
        WordBasic.CurValues.FilePageSetup PageDialog
        units = WordBasic.Val(PageDialog.LeftMargin)
    End If

    Dim OptDialog As Object: Set OptDialog = _
        WordBasic.DialogRecord.ToolsOptionsGeneral(False)
    WordBasic.CurValues.ToolsOptionsGeneral OptDialog

    If OptDialog.units = 1 Then
        units_$ = " centimeters"
        unit$ = "1 centimeter"
        twips = 566.9291  ' per centimeter
    Else  ' Units = 0
        units_$ = " inches"
        unit$ = "1 inch"
        twips = 1440  ' per inch
    End If ' no check for picas or points

    units = units + WordBasic.SelInfo(5) / twips

'   truncate to two decimal places

    If units > 9 Then  ' 6 characters wide
        units = WordBasic.Val(Mid(Str(units), 1, 6))
    Else  ' space unit dot tenth hundredth
        units = WordBasic.Val(Mid(Str(units), 1, 5))
    End If

    If units = 1 Then
        WordBasic.PrintStatusBar unit$
    Else
        WordBasic.PrintStatusBar units, units_$
    End If
End Sub


The JAWS script follows:

Script SayInches () 
   {control+alt+'} ;; run Word macro
   RouteInvisibleToPc ()
   InvisibleCursor ()
   JAWSPageDown ()
   SayLine ()
   PcCursor ()
EndScript 


Thank you again for trying SayInches.
---------
[EMAIL PROTECTED]



-
To unsubscribe, see the home page
http://yoyo.cc.monash.edu.au/~nallan/jfw





At 10:09 13/08/99 -0400, Rivera, Michael L LRH wrote:
>Dear Listers,
>
>Does anyone know how to determine the PC cursor position, in inches, on a
>line relative to the left margin in MS Word 97?  In WordPerfect there was
>the "POS" indicator at the bottom right which showed you exactly how far you
>were from the edge of the left margin in inches.  This was a useful
>indicator for me in preparing management and technical reports.
>
>I am aware of the ruler in Word, but this feature seems to be unusable for
>JFW users.
>Any help would be greatly appreciated.
>
>Regards,
>Michael Rivera 
>
>-
>Visit the jfw ml web page: http://jfw.cjb.net
>

-
Visit the jfw ml web page: http://jfw.cjb.net

Reply via email to