Reputation: 784
How do I make Microsoft Word to run a macro every time every time the user paste text?
I have recorded this macro:
Sub AdjustFontSize()
'
' AdjustFontSize Macro
' Adjusts font size
'
Selection.WholeStory
Selection.Font.Size = 24
End Sub
This changes the font size of everything in the document, and I want that to happen when the user is pasting text.
Upvotes: 3
Views: 1395
Reputation: 5471
Try this code.
Sub EditPaste()
Selection.Paste
Selection.WholeStory
Selection.Font.Size = 24
End Sub
EditPaste
is an in-built command. You can find it here.
What I did is to overwrite the existing command and added my code into it.
Upvotes: 7