daily pastebin goal
75%
SHARE
TWEET

Untitled

a guest Feb 13th, 2018 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Sub createAbbreviation()
  2.  
  3. Dim strFieldTextAbbr As String
  4.  
  5. If Selection.Type = wdSelectionIP Then
  6.   Load frmInsertAbbreviation
  7. Else
  8.   strAbbreviation = Selection.Text
  9.   Load frmInsertAbbreviation
  10. End If
  11.  
  12. frmInsertAbbreviation.Show
  13. If frmInsertAbbreviation.Tag = "Cancel" Then
  14.   Unload frmInsertAbbreviation
  15.   strAbbreviation = ""
  16.   Exit Sub
  17. End If
  18.  
  19. strFieldTextAbbr = """" & frmInsertAbbreviation.strAbbreviation & """ f Abbreviation t """ & frmInsertAbbreviation.strDefinition & """"
  20.  
  21. If Selection.Type = wdSelectionIP Then
  22.   If Selection.Font.Subscript = True Then
  23.     Selection.Font.Subscript = False
  24.   End If
  25.   ActiveDocument.Fields.Add Range:=Selection.Range, Type:=wdFieldIndexEntry, _
  26.     Text:=strFieldTextAbbr
  27. Else
  28.   Selection.MoveRight Unit:=wdCharacter, Count:=1
  29.   If Selection.Font.Subscript = True Then
  30.     Selection.Font.Subscript = False
  31.   End If
  32.   ActiveDocument.Fields.Add Range:=Selection.Range, Type:=wdFieldIndexEntry, _
  33.     Text:=strFieldTextAbbr
  34. End If
  35.  
  36. Unload frmInsertAbbreviation
  37. strAbbreviation = ""
  38.  
  39. End Sub}
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top