Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 03-02-2016, 12:47 AM
macropod's Avatar
macropod macropod is online now Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Try:
Code:
Sub InsertImages()
Application.ScreenUpdating = False
Dim i As Long
For i = 0 To 9
  With ActiveDocument.Range
    With .Find
      .ClearFormatting
      .Forward = True
      .Text = i
      .Replacement.Text = ""
      .Format = False
      .Wrap = wdFindStop
      .MatchCase = False
      .MatchWholeWord = False
      .MatchWildcards = False
      .MatchSoundsLike = False
      .MatchAllWordForms = False
      .Execute
    End With
    Do While .Find.Found
      .InlineShapes.AddPicture FileName:="C:\BMP Fonts\Q" & i & ".bmp", _
        LinkToFile:=False, SaveWithDocument:=True
      .Collapse wdCollapseEnd
      .Find.Execute
    Loop
  End With
Next
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 

Tags
font, replace, vba



Similar Threads
Thread Thread Starter Forum Replies Last Post
Find and Replace fonts? daroga Publisher 1 01-22-2016 09:13 PM
Slow "comparison/replace" script mavCZ Excel Programming 53 07-27-2014 10:57 AM
replace data from variable with "sub and super script" from excel to word by vba krishnaoptif Word VBA 9 06-22-2012 05:08 AM
WORD: Rtf and search-replace (regexp/fonts) seteshpl Word 1 09-06-2011 01:35 AM
Macro to Replace Fonts ballj_35 Word 3 05-10-2011 01:10 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:38 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft