🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.ms
Article #12355

Re: Need autosave macro for Winword

#12355
From: Guy Gallo
Date: Thu, 30 May 1991 06:39
84 lines
2987 bytes
In article <1991May30.003620.23077@amd.com> indra@ashirvad.amd.com (Indra Singhal) writes:
>victor@ccwf.cc.utexas.edu (Victor Menayang) writes:
>
>
>>I need an autosave macro for Word for Windows.
>>(I don't like just being reminded :-)
>>Anybody has written such macro?
>>I would appreciate it if s/he could
>>send me a copy (or perhaps post here).

This was posted on the net some time back;  I assume the author would not
mind my reposting:


Are there any macros for Word for Windows publicly available?
I haven't seen any being posted, or on simtel.
The following is a very simple autosave macro to use instead of
the silly thing built into W4W that bugs you to save at random
intervals.  If you've never played with the macro feature:

        run W4W
        pull down the macro menu
        click on edit (in the macro menu)
        enter savenow for the macro name
        cut and paste the following macro into the macro editor
        save it and the global command changes

In order to use it, you'll either need to assign it to a menu,
assign it to a key, or have it run when you start W4W (more about
that after the macro).

................................cut here...................................

Sub MAIN
If IsDirty() Then
        FileSave
        End If
now$ = Time$()
ap$ = Right$(now$, 2)
hour =  Val(Left$(now$, 2))
min =  Val(Mid$(now$, 4, 2))
min = min + 4
If min > 59 Then
        min = min - 60
        hour = hour + 1
        End If
If ap$ = "PM"  And hour <> 12 Then
        hour = hour + 12
        End If
If hour = 24 Then
        hour = 0
        End If
If min =  0 Then
        nextime$ = Right$(Str$(hour), 2) + ":00"
ElseIf min < 10 Then
        nextime$ = Right$(Str$(hour), 2) + ":0" + Right$(Str$(min), 1)
Else
        nextime$ = Right$(Str$(hour), 2) + ":" + Right$(Str$(min), 2)
        End If
OnTime nextime$, "savenow"
End Sub


.................................cut here..............................


If you'd like to have this run when you start W4W, create the macro
AutoExec and paste the following into it:

Sub MAIN
FileNew
If MsgBox("enable autosave?", 36) Then
        Print "autosave enabled"
        MacroRun "savenow"
        End If
End Sub

I expect to make this a little more sophisticated, and post a new version in
about a week, but I wanted to see if anyone else was writing macros.
-david

        preston@lll-crg.llnl.gov
        B4 f+ t- k+ s-/+ r P8/3 S6 b+/- g- l-/+ y- z/! n o+/++ x a+ u v-- j++
        D. R. Preston  584 Castro St. #614 SF CA 94114 USA
Technical Details
Message-ID: <1991May30.063956.9027@cunixf.cc.columbia.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!samsung!caen!sol.ctr.columbia.edu!cunixf.cc.columbia.edu!gg2

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!samsung!caen!sol.ctr.columbia.edu!cunixf.cc.columbia.edu!gg2
From: gg2@cunixf.cc.columbia.edu (Guy Gallo)
Newsgroups: comp.windows.ms
Subject: Re: Need autosave macro for Winword
Message-ID: <1991May30.063956.9027@cunixf.cc.columbia.edu>
Date: 30 May 91 06:39:56 GMT
Organization: Columbia University
Lines: 84