Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-09-2023, 04:34 AM
laith93 laith93 is offline Find and replace paragraph mark on selected text and replace it with space in PowerPoint VBA Windows 10 Find and replace paragraph mark on selected text and replace it with space in PowerPoint VBA Office 2019
Competent Performer
Find and replace paragraph mark on selected text and replace it with space in PowerPoint VBA
 
Join Date: Jul 2021
Posts: 117
laith93 is on a distinguished road
Lightbulb Find and replace paragraph mark on selected text and replace it with space in PowerPoint VBA

Hi,
I always copy from pdf files or webpage and appear as the follows:
46.png
All these lines belong to a single paragraph, so how to replace the paragraph mark on selected text inside textbox with space, I want to apply to selected text to prevent its effect on previously oragnized paragraph in the same text box.
I applied this code, but doesn't make sense
Code:
Sub findandreplacetext()
Dim sld As Slide
Set sld = ActivePresentation.Slides(1)
Dim shp As Shape
For Each shp In sld.Shapes
If shp.HasTextFrame Then
    If shp.TextFrame.HasText Then
        shp.TextFrame.TextRange.Text = Replace(shp.TextFrame.TextRange.Text, "vbCrLf", " ")
    End If
End If
Next shp
End Sub
I don't know what is the problem with this code, I replaced vbCrLf to char(13), but also nothing.
Any suggestion please
Thanks
Reply With Quote
Reply

Tags
find & replace, find character, power automate



Similar Threads
Thread Thread Starter Forum Replies Last Post
Find and replace only within selected text. eduzs Word VBA 0 02-08-2023 09:31 AM
a macro to replace paragraph mark with a space applies effect on paragraph marks after the selection drrr Word VBA 2 08-24-2021 03:05 AM
Find and replace paragraph mark on selected text and replace it with space in PowerPoint VBA Skip double paragraph mark during find and replace in MS Word? Jakov93 Word VBA 2 07-13-2021 11:07 PM
Find and replace paragraph mark on selected text and replace it with space in PowerPoint VBA Find and Replace Selected Text or Macro for finding selected text mrplastic Word VBA 4 12-20-2019 01:25 PM
Find and replace paragraph mark on selected text and replace it with space in PowerPoint VBA Replace space with paragraph mark jeffreybrown Word VBA 8 08-22-2018 03:31 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:14 AM.


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