Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #16  
Old 02-21-2014, 01:32 PM
macropod's Avatar
macropod macropod is offline replace letters by font without losing format Windows 7 32bit replace letters by font without losing format 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

If you're always processing only a single folder, you can replace:
Code:
strFolder = GetFolder
If strFolder = "" Then Exit Sub
strFile = Dir(strFolder & "\*.doc", vbNormal)
with:
Code:
strFolder = "My file path \*.doc", vbNormal)
where 'My file path ' is your file path, and delete:


Code:
Function GetFolder() As String
Dim oFolder As Object
GetFolder = ""
Set oFolder = CreateObject("Shell.Application").BrowseForFolder(0, "Choose a folder", 0)
If (Not oFolder Is Nothing) Then GetFolder = oFolder.Items.Item.Path
Set oFolder = Nothing
You should not make any changes other than the ones I posted - and you should make all of those; otherwise you can't expect the macro to work properly.

Note: Do not put the document holding the macro into the same folder as the files to be processed.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to replace digits with letters Bananabean Word VBA 6 09-14-2013 09:28 PM
replace letters by font without losing format How to replace all font occurencies by another (e.g. Arial-->Courier) pstein Word 1 04-30-2013 05:58 AM
replace letters by font without losing format Find and Replace maintain format winningson Word 3 01-19-2013 05:38 AM
replace letters by font without losing format Format Font herbhh Word 10 05-23-2011 08:29 AM
How do I import text columns with specified spacing between words w/o losing format? Fucius Word 0 08-09-2010 06:23 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:07 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