-
Feb 3rd, 2012, 04:57 AM
#1
Thread Starter
New Member
Remove '' character from word
I want to remove in word docs using a macro please.
Any idea how to do this please?
Thanks in advance.
-
Feb 3rd, 2012, 05:39 AM
#2
Hyperactive Member
Re: Remove '' character from word
Hi boots_nz,
Your question, although possible in VB.NET, is a VBA question and therefore in the wrong forum.
I'll let a moderator know it needs moving so that you can get the help that you're after.
-
Feb 3rd, 2012, 09:30 AM
#3
Re: Remove '' character from word
-
Feb 3rd, 2012, 12:30 PM
#4
Re: Remove '' character from word
"" is not really a character as its an unprintable character or unicode character which could be any number of characters. What you need to do is determine which it is.
Use a breakpoint in your code and stop where you are wanting to clean the word. Use the immediate window and do a ?ASC("")
This will print out the "" ASCII code number for your undesired character. You can then use code to parse that character out since you know its number.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
-
Feb 4th, 2012, 06:03 AM
#5
Re: Remove '' character from word
Use a breakpoint in your code and stop where you are wanting to clean the word. Use the immediate window and do a ?ASC("")
i do not believe it is that simple, will return the ascii value for ? (63)
try recording a macro in word, shows the character as posted here is unicode
vb Code:
Selection.Find.ClearFormatting With Selection.Find .Text = ChrW(61540) .Replacement.Text = ""
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Feb 4th, 2012, 09:22 PM
#6
Re: Remove '' character from word
Originally Posted by RobDog888
"" is not really a character ...
RobDog
Given that, how on earth did you get said square to appear
in your post?
I tried Alt-63, but that returns a "?"
Spoo
Last edited by Spoo; Feb 4th, 2012 at 09:26 PM.
Reason: I also tried Alt-0 thru Alt-39 .. no dice
-
Feb 4th, 2012, 11:04 PM
#7
Re: Remove '' character from word
Given that, how on earth did you get said square to appear
in your post?
copy and paste
browsers support unicode much better than vb6 /VBA
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Feb 5th, 2012, 10:07 AM
#8
Re: Remove '' character from word
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|