FAQ

Foire aux questions pour l'auto-assistance.

Veuillez jeter un coup d'œil aux questions (et réponses) courantes dans la liste par défaut. Si vous ne trouvez pas ce que vous cherchez, commencez par sélectionner votre version Ability Office , puis affinez-la en saisissant le texte de recherche et/ou la catégorie.

Article de la base de connaissances 94

Write macro to delete previous/next word

Some word processors (including Ability Write v4) support "Delete Previous Word" when Ctrl-Backspace is pressed. Similarly "Delete Next Word" for Ctrl-Delete. This macro example shows how Ability can made to do the same and includes how to assign a keystroke to a macro.

1. Start Write

2. Select Tools/Macros/Macro Editor

3. Copy and Paste all the text below into the Macro editor screen.

Sub DelPrevWord
  With ActiveDocument
    i = .Selection.End -1 
    ch = .Text(i)

    While ch = 32
      i = i - 1
      If i < 0 Then
        ch = "0"
      Else
        ch = .Text(i)
      End If
    Wend
  End With 

  With ActiveDocument.Selection 
    .Start = i
    .Collapse abForw
    .Cut
  End With

End Sub

Sub DelNextWord
  With ActiveDocument
    i = .Selection.End
    ch = .Text(i)

    While ch = 32
      i = i + 1
      If i > .Text.Count Then
        ch = "0"
      Else
        ch = .Text(i)
      End If
    Wend
  End With

  With ActiveDocument.Selection
   .End = i
   .Collapse abBack
   .Cut
  End With
End Sub

4. Click the Save button

5. Use the Window menu to return to your document (any document)

6. Select Tools/Customize and the Macro Shortcuts tab

7. Click on the Macro DelPrevWord

8. Click in the "Select New Shortcut" edit box and press Ctrl-Backspace

9. Click "Assign" button

10. Repeat 7 to 9 with DelNextWord macro and Ctrl-Delete

11. Save and test