![]() |
|
|
|
#1
|
|||
|
|||
|
I've been using Word since version 1.0 came out over 30 years ago. However, I have never created a macro, in Word or any other app.
![]()
|
|
#2
|
||||
|
||||
|
Quote:
For PC macro installation & usage instructions, see: http://www.gmayor.com/installing_macro.htm For Mac macro installation & usage instructions, see: https://wordmvp.com/Mac/InstallMacro.html The macro name 'Demo' can be changed to any valid name you care to use. As for parens, brackets, etc., you might re-code the sub as: Code:
Sub Demo()
Application.ScreenUpdating = False
Dim StrEnc As String, ChrA As String, ChrB As String
StrEnc = InputBox("What are the enclosing charaters?" & vbCr & "(e.g. <>, (), [], {}, «», '', """")")
Select Case StrEnc
Case "<>": ChrA = "<": ChrB = ">"
Case "()": ChrA = "(": ChrB = ")"
Case "[]": ChrA = "[": ChrB = "]"
Case "{}": ChrA = "{": ChrB = "}"
Case "«»": ChrA = "«": ChrB = "»"
Case "''": ChrA = Chr(145): ChrB = Chr(146)
Case Chr(34) & Chr(34): ChrA = Chr(147): ChrB = Chr(148)
Case Else: Exit Sub
End Select
With Selection
.InsertBefore ChrA
.InsertAfter ChrB
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Create an "action safe" border around slide content? | Pantucci | PowerPoint | 2 | 04-21-2018 08:49 AM |
PPT 2010 Action - Run Program reverses "/" switch character
|
wflett | PowerPoint | 4 | 03-17-2015 04:03 AM |
| remove repeated words with " macro " or " wild cards " in texts with parentheses and commas | jocke321 | Word VBA | 2 | 12-10-2014 11:27 AM |
Word Macro to find and delete rows that contain adjacent cells containing "."
|
AlexanderJohnWilley | Word VBA | 7 | 11-08-2012 10:15 AM |
Launch macro sub after hitting "create pdf" button in word
|
webharvest | Word VBA | 1 | 06-29-2011 04:56 PM |