How to remove tab characters in Powerpoint presentation
Thread poster: Erik Freitag

Erik Freitag  Identity Verified
Germany
Local time: 17:53
Member (2006)
Dutch to German
+ ...
Jan 29, 2016

Dear colleagues,

I'm looking for a way to search tab characters and replace them with a space in Powerpoint (2010). How can I do that? I've tried ^t as a search argument, but that doesn't seem to work.

Many thanks in advance,
kind regards,
Erik


 

Dan Lucas  Identity Verified
United Kingdom
Local time: 16:53
Member (2014)
Japanese to English
VBA Jan 29, 2016

Erik Freitag wrote:
I'm looking for a way to search tab characters and replace them with a space in Powerpoint (2010). How can I do that? I've tried ^t as a search argument, but that doesn't seem to work.

I have been using this snippet for a year or two, adapted from the internet somewhere. The indentation is messed up but it shouldn't matter in VBA. Hit Alt + F11, insert a VBA module, then paste and run.

Sub ReplaceTabs()
Dim osld As Slide
Dim oshp As Shape
For Each osld In ActivePresentation.Slides
For Each oshp In osld.Shapes
If oshp.HasTextFrame Then
'look for newline followed by Tab and switch to SPACE
With oshp.TextFrame.TextRange
.Text = Replace(.Text, vbTab, " ")
End With
End If
Next oshp
Next osld
End Sub


 

Erik Freitag  Identity Verified
Germany
Local time: 17:53
Member (2006)
Dutch to German
+ ...
TOPIC STARTER
That changes a lot of other things, too Jan 29, 2016

Dear Dan,

Thanks a lot. Unfortunately, that changes a lot of other things as well (at least on one slide), for example: text colour and size, bold, underlines etc.

Any other ideas?

Kind regards,
Erik


 

Dan Lucas  Identity Verified
United Kingdom
Local time: 16:53
Member (2014)
Japanese to English
Try again Jan 29, 2016

Erik Freitag wrote:
Unfortunately, that changes a lot of other things as well (at least on one slide), for example: text colour and size, bold, underlines etc. Any other ideas?

Umm. Yeah, apparently those side effects are a thing when you use replace. How annoying. Try this instead. Something else I just copied and adjusted a little.

Sub ReplaceTabs()

Dim oSld As Slide
Dim oShp As Shape
Dim oTxtRng As TextRange
Dim oTmpRng As TextRange

For Each oSld In ActivePresentation.Slides
For Each oShp In oSld.Shapes
Set oTxtRng = oShp.TextFrame.TextRange
Set oTmpRng = oTxtRng.Replace(FindWhat:=vbTab, _
Replacewhat:=" ", WholeWords:=False)
Do While Not oTmpRng Is Nothing
Set oTxtRng = oTxtRng.Characters(oTmpRng.Start + _
oTmpRng.Length, oTxtRng.Length)
Set oTmpRng = oTxtRng.Replace(FindWhat:=vbTab, _
Replacewhat:=" ", WholeWords:=False)
Loop
Next oShp
Next oSld

End Sub


Regards
Dan


 

Stepan Konev  Identity Verified
Russian Federation
Local time: 18:53
English to Russian
Ctrl+H Jan 29, 2016

1. Find any tab in your presentation. If you can't, just type it anywhere (but don't forget to delete it at the end).
2. Select the tab and press Ctrl+C
3. Press Ctrl+H
4. Tab will automatically appear in the Find field. If not, put cursor into the Find field and press Ctrl+V
5. Type space in the Replace field
6. Press Replace all

[Edited at 2016-01-29 21:09 GMT]


 

Erik Freitag  Identity Verified
Germany
Local time: 17:53
Member (2006)
Dutch to German
+ ...
TOPIC STARTER
Thanks to both of you! Jan 30, 2016

Thanks, Stepan! Works perfectly. No idea why I didn't think of this myself. Embarrassing!icon_wink.gif

@Dan: Thanks a lot for your other suggestion! I haven't tried it after reading Stepan's post...


 

Dan Lucas  Identity Verified
United Kingdom
Local time: 16:53
Member (2014)
Japanese to English
Lateral thinking Jan 30, 2016

Erik Freitag wrote:
Thanks, Stepan! Works perfectly. No idea why I didn't think of this myself. Embarrassing!icon_wink.gif
@Dan: Thanks a lot for your other suggestion! I haven't tried it after reading Stepan's post...

I know, I blushed myself. Well done Stepan for cutting the Gordian knot. I even think he's suggested it before on the forum...

Dan


 

Rolf Keller
Germany
Local time: 17:53
English to German
Office 2007 and later provides are other ways Jan 30, 2016

An Office file (2007 & later) consists of a bunch of files (text files, image files and others) that are embedded in a .zip file.

So, rename .pptx to .zip, extract it and edit the appropriate text file (e. g. slide1.xml) using any text editor. Make sure to keep plain text in the .xml file. Then put slide.xml back into the .zip file and rename .zip back to .pptx.

Unfortunately this method doesn't loop through all slides automatically. But it can be useful for certain other editing tasks. It can even be used to edit pictures, provided you keep their size.


 


To report site rules violations or get help, contact a site moderator:


You can also contact site staff by submitting a support request »

How to remove tab characters in Powerpoint presentation

Advanced search






WordFinder Unlimited
For clarity and excellence

WordFinder is the leading dictionary service that gives you the words you want anywhere, anytime. Access 260+ dictionaries from the world's leading dictionary publishers in virtually any device. Find the right word anywhere, anytime - online or offline.

More info »
Protemos translation business management system
Create your account in minutes, and start working! 3-month trial for agencies, and free for freelancers!

The system lets you keep client/vendor database, with contacts and rates, manage projects and assign jobs to vendors, issue invoices, track payments, store and manage project files, generate business reports on turnover profit per client/manager etc.

More info »



Forums
  • All of ProZ.com
  • Term search
  • Jobs
  • Forums
  • Multiple search