Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!lll-winken!lll-crg.llnl.gov!preston From: preston@lll-crg.llnl.gov (David R Preston) Newsgroups: comp.windows.ms Subject: W4W AutoSave macro Message-ID: <87252@lll-winken.LLNL.GOV> Date: 5 Dec 90 11:33:27 GMT Sender: usenet@lll-winken.LLNL.GOV Organization: Lawrence Livermore National Laboratory Lines: 70 Nntp-Posting-Host: lll-crg.llnl.gov 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