None printing character

User avatar
Dave Davison
SilverLounger
Posts: 1859
Joined: 27 Jan 2010, 19:15
Location: Darlington, Co. Durham. UK

None printing character

Post by Dave Davison »

What are these none printing characters & how can I delete them all using the "Find and delete all" function as where they appear at the beginning of a sentence they prevent me using the "Drop Cap" macro. Thanks a lot Dave :scratch:
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78790
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: None printing character

Post by HansV »

The · represents an ordinary space, and ¶ marks the end of a paragraph.
I don't know what the square within a square is, but you can delete it as follows:
Select one such character. then press Ctrl+C to copy it.
Press Ctrl+H to activate the Replace dialog.
Click in the 'Find what' box and clear its contents (if any). Then press Ctrl+V to paste the square character.
Leave the 'Replace with' box empty, then click 'Replace All'.
Best wishes,
Hans

User avatar
kdock
5StarLounger
Posts: 722
Joined: 21 Aug 2011, 21:01
Location: The beautiful hills of Western North Carolina

Re: None printing character

Post by kdock »

If this was copied/pasted from the web, they could represent characters from a different language than the one set in Windows or Word. There is no character mapped, or your current font has no character defined for that mapping, so it displays the black square within another square instead.

Hans' advice is indeed the quickest way to remove them. You don't need to know what they represent.

Kim
"Hmm. What does this button do?" Said everyone before being ejected from a car, blown up, or deleting all the data from the mainframe.

User avatar
Charles Kenyon
5StarLounger
Posts: 640
Joined: 10 Jan 2016, 15:56
Location: Madison, Wisconsin

Re: None printing character

Post by Charles Kenyon »

Drop Cap macro?
Or the DropCap feature under the Insert tab? :smile:

Image
https://addbalance.com/word/ribbons.htm#Drop_Cap_Menu

User avatar
Dave Davison
SilverLounger
Posts: 1859
Joined: 27 Jan 2010, 19:15
Location: Darlington, Co. Durham. UK

Re: None printing character

Post by Dave Davison »

In conclusion; the method Hans suggested is one I use regularly when editing word docs converted from PDF's which have unusual formatting but on this occasion unfortunately the said symbol - I've discovered- does in fact copy to the clipboard and pastes ok into a Word doc but not into the field of the "Find and replace" function so the case rests unsolved I'm afraid. Regards anyway Dave.

User avatar
HansV
Administrator
Posts: 78790
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: None printing character

Post by HansV »

Could you attach the document, or a copy of a part of the document that contains the problem character?
Best wishes,
Hans

jolas
3StarLounger
Posts: 206
Joined: 02 Feb 2010, 23:58

Re: None printing character

Post by jolas »

They maybe are optional break that maybe hidden from the Word Options >>Display settings.

User avatar
Dave Davison
SilverLounger
Posts: 1859
Joined: 27 Jan 2010, 19:15
Location: Darlington, Co. Durham. UK

Re: None printing character

Post by Dave Davison »

Hi Hans, my initial post regarding this trivial matter contained a screen shot of a section of a page showing the said symbol. Here is a full page. Regards Dave.
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78790
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: None printing character

Post by HansV »

It is a weird character indeed. You can remove it as follows:
Press Alt+F11 to activate the Visual Basic Editor.
Press Ctrl+G to activate the Immediate window.
Copy the following line into the Immediate window:

ActiveDocument.Content.Find.Execute FindText:=ChrW(-257), Replace:=wdReplaceAll

With the insertion point in that line, press Enter.
Press Alt+F4 to close the Visual Basic Editor.
Best wishes,
Hans

User avatar
Dave Davison
SilverLounger
Posts: 1859
Joined: 27 Jan 2010, 19:15
Location: Darlington, Co. Durham. UK

Re: None printing character

Post by Dave Davison »

Sorry Hans. The fault must be mine but I can't get the said offending character to delete following your precise instructions. Granted, it is nothing to lose sleep over but -for you - it is obviously a small hurdle that can be summounted. Thanks anyway Dave.

User avatar
HansV
Administrator
Posts: 78790
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: None printing character

Post by HansV »

Sorry about that - it worked for me in the sample document that you attached...
Best wishes,
Hans

snb
4StarLounger
Posts: 596
Joined: 14 Nov 2012, 16:06

Re: None printing character

Post by snb »

Alternative:

Code: Select all

Sub M_snb()
   sn = Split(StrConv(ActiveDocument.Content, 64), Chr(0))
   MsgBox Replace(Join(Filter(sn, sn(0), 0), ""), Chr(25), "'")
   activedocument.content=Replace(Join(Filter(sn, sn(0), 0), ""), Chr(25), "'")
End Sub[\code]

User avatar
Dave Davison
SilverLounger
Posts: 1859
Joined: 27 Jan 2010, 19:15
Location: Darlington, Co. Durham. UK

Re: None printing character

Post by Dave Davison »

SORRY snb that macro? Is above my head I'm afraid, but the good news is I have found another site where the book can be read on line and I have discovered that by highlighting the entire text it can be copied and pasted into a Word doc where it is editable if required. Thanks also Hans as ever, greatfull for the help.

snb
4StarLounger
Posts: 596
Joined: 14 Nov 2012, 16:06

Re: None printing character

Post by snb »

Don't keep your head down.;)

User avatar
Dave Davison
SilverLounger
Posts: 1859
Joined: 27 Jan 2010, 19:15
Location: Darlington, Co. Durham. UK

Re: None printing character

Post by Dave Davison »

My head sure is not down as you suggests snb, but on the contrary, looking up as counselled to do in Luke 21-28 Dave

User avatar
DocAElstein
5StarLounger
Posts: 639
Joined: 18 Jan 2022, 15:59
Location: Re-routing rivers, in Hof, Beautiful Bavaria

Re: None printing character

Post by DocAElstein »

Just my 2 cents, I certainly agree it’s worthy to be brave and look up, and maybe we should do it, but be wary, – bear in mind it might be your downfall if your head gets shot off - Alan 24-05-2024
I seriously don’t ever try to annoy. Maybe I am just the kid that missed being told about the King’s new magic suit, :(

snb
4StarLounger
Posts: 596
Joined: 14 Nov 2012, 16:06

Re: None printing character

Post by snb »

It really won't do any harm to test my macro: thumbs up, heads up !

User avatar
Dave Davison
SilverLounger
Posts: 1859
Joined: 27 Jan 2010, 19:15
Location: Darlington, Co. Durham. UK

Re: None printing character

Post by Dave Davison »

Would gladly do do if I knew how to apply the info.....only ever created one macro but the method was unorthodox to say the least [but it works] and in no way resembled the normal way you pros do it. Thanks Dave.

User avatar
Charles Kenyon
5StarLounger
Posts: 640
Joined: 10 Jan 2016, 15:56
Location: Madison, Wisconsin

Re: None printing character

Post by Charles Kenyon »


User avatar
DocAElstein
5StarLounger
Posts: 639
Joined: 18 Jan 2022, 15:59
Location: Re-routing rivers, in Hof, Beautiful Bavaria

Re: None printing character

Post by DocAElstein »

Hi Dave, (and anyone else passing)
I realise that Dave has this wrapped up good enough for him, but I thought this offering might be an interesting contribution to the thread anyway.
Having said that, I will stop short of all I was going to do, and just do the first bit, and wait to see if I get any feedback to set me straight, because I am not sure if I might be barking up the wrong tree. – I am not sure if I am missing something, or missing the point as usual, because when I open Dave’s file I see nothing strange?
Dave Word docx file.JPG
_.___________

OK, so for the time being I will ignore that and do the first bit I was going to do. It is very similar to what I did in a recent post here - https://eileenslounge.com/viewtopic.php ... 27#p316927

I will just give the brief shortened summary for now.
So I do a VBA coding, (which is in an Excel file), very similar to what I did at that post , and that coding does the following ….
It opens Dave’s file symbol.docx, then saves it under a different extension, symbol.htm , then closes that new file.
Word allows you to do that, save a file under that different .htm extension. - I am not sure why, but it can be very useful because a htm / html file can be opened with a simple text editor, or alternatively, in a similar vain, taken into VBA as a single long string of text. Now, the useful thing is, that text is fairly readable – a lot of it is normal understandable words and characters, rather than a lot of weird looking symbols and gobbledygook that you would see if you opened a .docx file with a text editor.
So my coding gets that long string of text, which is the entire file, and then it does some fairly simple string manipulation to get the main text that you see.
Then, for convenience, just as one way to look at that main text, it puts it in the first cell of a worksheet.
Initially it looks like this
DaveGot65279StuffGodKnowsWhat.JPG

The only thing that looks strange there to me is that

stuff. I am out of my depths here, but a quick google says that is some sort of space / break character. Maybe that is what jolas was meaning?
Now interestingly, in my coding, I already remove something similar, - this thing:
 
According to the internet, they are also some sort of break/ space thing. I never really knew what they were about, but it seemed to be something I did not want so a simple code line removes them.
So just one extra code line is needed to get rid of the  stuff, then the coding pastes the text out, for example, in cell A2, and I get your text, nice and clean
DaveWithout65279.JPG


I will leave it at then for now, pending perhaps someone telling me if I am on the right tracks or wildly missing the point.

I am interested to look further for a couple of reasons ,
_ In that recent previous Thread, Mike (Speakeasy) introduced a rather impressive way to get your main text from a word file displayed. So it would be interesting to see what that makes of the sample file, symbol.docx
_ I might try that snb offering. - Once in a while it is worth it, as long as you are fairly familiar with VBA and his style. It might be a bit mean though if you are new to VBA, ( and snb Lol ), definitely like putting your head up to get it shot off , or jumping into the deep end chained to an anchor, Lol.
( By the way, Dave, if you do ever want to take the plunge and get into VBA, you will be flooded by tutorials. You can save yourself some time , IMO, by just checking out that one from Charles ,- it seems just about right, taking you clearly up to, and including, putting you coding to run off of shortcuts, something which I have found extremely useful, in Word, in particular.
(I might be very slightly biased as he shows a range of the earlier versions of Word, which JIMHO, are the ones to standardise yourself on, as for Office itself, JIMHO again)

Alan


_.________________________________


DaveWithandWithout65279Stuff.xls https://app.box.com/s/b2pxd4gd4dfkdsua66xycvjrgm1b277n
You do not have the required permissions to view the files attached to this post.
I seriously don’t ever try to annoy. Maybe I am just the kid that missed being told about the King’s new magic suit, :(