Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-20-2024, 09:48 PM
Guessed's Avatar
Guessed Guessed is offline Remove hyphenation from copied text from pdf in Word VBA Windows 10 Remove hyphenation from copied text from pdf in Word VBA Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,166
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Try this version which works on your brief sample - it appears the dash is using the extended Ascii codes.


Code:
Sub Macro1()
  With ActiveDocument.Range.Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Text = ChrW(8209) & " "
    .Replacement.Text = ""
    .Forward = True
    .Wrap = wdFindContinue
    .Format = False
    .MatchCase = False
    .MatchWholeWord = False
    .MatchKashida = False
    .MatchDiacritics = False
    .MatchAlefHamza = False
    .MatchControl = False
    .MatchWildcards = False
    .MatchSoundsLike = False
    .MatchAllWordForms = False
    .Execute Replace:=wdReplaceAll
  End With
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #2  
Old 03-20-2024, 09:53 PM
Jakov93 Jakov93 is offline Remove hyphenation from copied text from pdf in Word VBA Windows 10 Remove hyphenation from copied text from pdf in Word VBA Office 2010
Advanced Beginner
Remove hyphenation from copied text from pdf in Word VBA
 
Join Date: Jul 2021
Posts: 51
Jakov93 is on a distinguished road
Default

Thanks so much Andrew
It works perfectly
You are the hard task man
Thanks again
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Remove hyphenation from copied text from pdf in Word VBA word hyphenation rogiburn Word 3 05-12-2021 10:24 AM
Remove hyphenation from copied text from pdf in Word VBA How do I remove [enter]s in copied doc? technofleep Word 7 06-28-2016 04:39 PM
Remove hyphenation from copied text from pdf in Word VBA Word 2003 Brackets appear around copied text barrage Word 1 12-16-2015 02:59 PM
Remove hyphenation from copied text from pdf in Word VBA Finding and Replacing a word with text copied to clip board spc94 Word VBA 3 06-25-2015 04:46 AM
Copied shape/text box pastes as an image in Word spectator Word 0 06-04-2014 08:45 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:34 AM.


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