Monday, April 20, 2020

Microsoft Word VBA Snippet Code 1


when you want to operate in Microsoft Word more lightly you can using Microsoft Word VBA ( Visual Basic Application ). How to add Microsoft Word VBA or Macro:

  1. First you can access by opening your Microsoft Word software.
  2. Then press Alt+F11.
  3. Click menu Insert > Module
  4. Add sub procedure by typing Sub and name with every suitable name that follow Microsoft Visual Basic notation.
  5. And you can copy paste or type any of this following Microsoft Word VBA snippet code.


for typing after our selection or our cursor:
Selection.InsertAfter "Some text"

the following statement copies the contents of the current selection to the Clipboard:Selection.Copy

Select paragraf
Selection.StartOf wdParagraph, wdExtend

same as press Backspace
Selection.TypeBackspace

reference:
https://sourcedaddy.com/
https://www.automateexcel.com/

No comments:

Post a Comment