Results 1 to 8 of 8

Thread: Remove '' character from word

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2012
    Posts
    2

    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.

  2. #2
    Hyperactive Member
    Join Date
    Jul 2011
    Posts
    278

    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.

  3. #3
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Remove '' character from word

    Thread moved

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,710

    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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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

  5. #5
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    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:
    1. Selection.Find.ClearFormatting
    2.     With Selection.Find
    3.         .Text = ChrW(61540)
    4.         .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

  6. #6
    PowerPoster Spoo's Avatar
    Join Date
    Nov 2008
    Location
    Right Coast
    Posts
    2,656

    Re: Remove '' character from word

    Quote Originally Posted by RobDog888 View Post
    "" 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

  7. #7
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    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

  8. #8
    PowerPoster Spoo's Avatar
    Join Date
    Nov 2008
    Location
    Right Coast
    Posts
    2,656

    Re: Remove '' character from word

    Pete

    Nice trick.

    Spoo

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width