Turn word wrap on/off for all open documents

Ask questions about how to create a script or swap scripts with other users.
Post Reply
User avatar
Rickard Johansson
Site Admin
Posts: 6625
Joined: 19 Jul 2006 14:29

Turn word wrap on/off for all open documents

Post by Rickard Johansson »

Two scripts for ramon (and others who might be interested...).

Here are 2 simple scripts to turn word wrap on/off for all open documents.

Turn word wrap on:

Code: Select all

// Pascal script
// Turn on word wrap for all open documents.

// Global variables
var
   n: Integer;

// Enter code here
begin
   for n := 0 to MainApp.DocumentCount -1 do
   begin
      MainApp.DocumentIndex := n;
      Document.Wordwrap := True;
   end;
end.  
Turn word wrap off:

Code: Select all

// Pascal script
// Turn off word wrap for all open documents.

// Global variables
var
   n: Integer;

// Enter code here
begin
   for n := 0 to MainApp.DocumentCount -1 do
   begin
      MainApp.DocumentIndex := n;
      Document.Wordwrap := False;
   end;
end.  
Paste in the script editor and save. You should add them as tools and maybe add buttons to a tool bar.
ramon
Posts: 160
Joined: 10 Oct 2009 20:17

Post by ramon »

Wow... thank you Rickard!

Works great!
Post Reply