Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 03-20-2024, 01:30 PM
vivka vivka is offline Remove hyphenation from copied text from pdf in Word VBA Windows 7 64bit Remove hyphenation from copied text from pdf in Word VBA Office 2016
Expert
 
Join Date: Jul 2023
Posts: 302
vivka is on a distinguished road
Default

Strange, because for me it works smoothly on your sample.
Try the full code:
Code:
Sub RemoveDashSpace()
    Dim oRng   As range
    If Len(selection.range) = 0 Then
        MsgBox "Select the text first", vbCritical
        Exit Sub
    End If
    Set oRng = selection.range
    
    With oRng.Find
        .ClearFormatting
        .Replacement.ClearFormatting
        .text = Chr(30) & Chr(32)
        .Replacement.text = ""
        .Forward = True
        .Wrap = wdFindStop
        .Format = False
        .MatchAllWordForms = False
        .MatchSoundsLike = False
        .MatchWildcards = True
        .Execute Replace:=wdReplaceAll
    End With
End Sub
Reply With Quote
 



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 03:32 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