Jun 14th, 2005, 07:23 AM
#1
Thread Starter
Frenzied Member
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
Jun 14th, 2005, 11:35 AM
#2
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:
'This will search for "s" and replace the "s" with a bold "[b]s[/b]".
With ActiveDocument.Content.Find
.Format = True
.Replacement.Font.Bold = True
.Execute Forward:=True, Replace:=wdReplaceAll, FindText:="s", ReplaceWith:="s"
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 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
Jun 15th, 2005, 06:59 AM
#3
Thread Starter
Frenzied Member
Re: Problem with Microsoft Word XP 2002 / XP 2003
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:
'This will search for "s" and replace the "s" with a bold "[b]s[/b]".
With ActiveDocument.Content.Find
.Format = True
.Replacement.Font.Bold = True
.Execute Forward:=True, Replace:=wdReplaceAll, FindText:="s", ReplaceWith:="s"
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.
Jun 15th, 2005, 11:19 AM
#4
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 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
Jun 16th, 2005, 05:00 AM
#5
Thread Starter
Frenzied Member
Re: Problem with Microsoft Word XP 2002 / XP 2003
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.
Jun 16th, 2005, 10:47 AM
#6
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 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
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