![]() |
#4
|
||||
|
||||
![]()
Try this code
Code:
Sub Macro1() Dim iWords As Double, sFiller As String, arrFiller() As String, i As Integer sFiller = "I didn't bother to attempt my homework by myself but I asked someone on the internet to do it for me" arrFiller = Split(sFiller, " ") iWords = ActiveDocument.Words.Count Debug.Print iWords If iWords < 20 Then For i = 0 To 20 - iWords ActiveDocument.Range.InsertAfter " " & arrFiller(i) Next i End If End Sub
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
Tags |
vba code, word vba code, word vba macro |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
benfarley | Word VBA | 1 | 03-30-2022 08:35 PM |
How to find (highlight) two and more words in a list of 75k single words in Word 2010 | Usora | Word | 8 | 05-29-2018 03:34 AM |
![]() |
thudangky | Word | 13 | 12-12-2013 02:22 AM |
![]() |
icsjohn | Word VBA | 2 | 12-07-2011 06:44 PM |
Why Words doesn’t show the style of the selected words automatically???? | Jamal NUMAN | Word | 0 | 04-14-2011 03:20 PM |