Results 1 to 6 of 6

Thread: Problem with Microsoft Word XP 2002 / XP 2003

  1. #1

    Thread Starter
    Frenzied Member cssriraman's Avatar
    Join Date
    Jun 2005
    Posts
    1,465

    Exclamation Problem with Microsoft Word XP 2002 / XP 2003

    Hi all,

    Alert about Micorsoft Word Issue/Bug:

    We are facing some issues when working with Find and Replace option with Microsoft Word XP.

    Please see the attachment, If you guys have any solution to that, pls let me know.

    Pls update with your valuable comments.

    Thanks,

    CS.
    Attached Files Attached Files

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

    Re: Problem with Microsoft Word XP 2002 / XP 2003

    No bug, just needing to completely use the function.

    Next time it may be better to just paste the doc text instead.


    VB Code:
    1. 'This will search for "s" and replace the "s" with a bold "[b]s[/b]".
    2.  
    3.     With ActiveDocument.Content.Find
    4.         .Format = True
    5.         .Replacement.Font.Bold = True
    6.         .Execute Forward:=True, Replace:=wdReplaceAll, FindText:="s", ReplaceWith:="s"
    7.     End With
    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

  3. #3

    Thread Starter
    Frenzied Member cssriraman's Avatar
    Join Date
    Jun 2005
    Posts
    1,465

    Re: Problem with Microsoft Word XP 2002 / XP 2003

    Quote Originally Posted by RobDog888
    No bug, just needing to completely use the function.

    Next time it may be better to just paste the doc text instead.


    VB Code:
    1. 'This will search for "s" and replace the "s" with a bold "[b]s[/b]".
    2.  
    3.     With ActiveDocument.Content.Find
    4.         .Format = True
    5.         .Replacement.Font.Bold = True
    6.         .Execute Forward:=True, Replace:=wdReplaceAll, FindText:="s", ReplaceWith:="s"
    7.     End With
    Hi, Pls check the attached word file (previous post) carefully. I never typed any word manually. I haven't used the coding to find and replace here. If I find and replace a word which contains individual formatting, after replacing the word the individual formatting is gone forever. For example, pls look at the attached word file (previous post). Thanks, CS.

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

    Re: Problem with Microsoft Word XP 2002 / XP 2003

    You can not just execute a .Find and keep formatting unless you prepare it.

    The basic .Find will clear all formatting on the search/replace criteria unless you set the Replacement object with the formatting you wish
    and designate the Format:=True in the Find cruiteria.
    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

    Thread Starter
    Frenzied Member cssriraman's Avatar
    Join Date
    Jun 2005
    Posts
    1,465

    Re: Problem with Microsoft Word XP 2002 / XP 2003

    Quote Originally Posted by RobDog888
    You can not just execute a .Find and keep formatting unless you prepare it.

    The basic .Find will clear all formatting on the search/replace criteria unless you set the Replacement object with the formatting you wish
    and designate the Format:=True in the Find cruiteria.
    I will not use any vba coding here. I just using the Word Find and Replace (By pressing the Ctrl + H) to find and replace a word as I mentioned in the attachement. Pls check and if you find any solution let me know. I am not facing any issues with Office 2000. But in Office XP 2002 and 2003 only I am facing the issue. Thanks! CS.

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

    Re: Problem with Microsoft Word XP 2002 / XP 2003

    Oh, sorry for the misunderstanding. I will test it out again manually and see what I can come up with.
    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

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