Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 10-13-2023, 08:21 PM
syl3786 syl3786 is offline Deleting styles but keep text's format Windows 10 Deleting styles but keep text's format Office 2019
Advanced Beginner
Deleting styles but keep text's format
 
Join Date: Jan 2023
Posts: 97
syl3786 is on a distinguished road
Exclamation Deleting styles but keep text's format

Hello everyone,



I have two macros. The first one copies text from Word to Excel based on an Excel list, while the second one adds hyperlinks according to an Excel file.

Recently, I encountered an issue where the text I want the macro to copy has different styles. E.g.: Selection.Style = ActiveDocument.Styles("ABCF2")"



However, this limitation prevents the macro from copying text, even though I already added the following code to inform the macro to identify and copy them:


With Selection.Find
.Font.Name = "Times New Roman"
.Font.Size = 14
.Font.Underline = 0
.Font.Color = wdColorBlack
.MatchWildcards = True



To address this problem, I manually applied the same font name to the text, which allowed the macro to recognize and copy it.

I would greatly appreciate any suggestions or solutions to overcome this challenge. Thank you in advance.
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Deleting all text from a slide pack without deleting the formatting redordead2389 PowerPoint 0 05-31-2023 06:50 AM
Format text between two styles Bikram Word VBA 4 08-08-2021 11:39 PM
Deleting styles in Word2016-32 bit version kae0088 Word VBA 8 12-07-2020 11:19 AM
Using Styles in Templates to help format text - Importing and working with Templates daithy Word 2 01-03-2020 05:06 PM
Deleting styles but keep text's format Problem with using Styles to format text. cummins Word 3 08-16-2012 05:34 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:52 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft