Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-08-2024, 02:04 AM
RRB's Avatar
RRB RRB is offline Looking for Macro Windows 11 Looking for Macro Office 2021
Susan Flamingo
Looking for Macro
 
Join Date: May 2014
Location: The Holy City of Jerusalem
Posts: 301
RRB is on a distinguished road
Default

Hi - it is me here again to bother you. Hope you are not getting sick of me...



The document I am doing my scholarly work on is in Hebrew. In Hebrew we use many acronyms that are designated as such with double quotes in them.

So 'Washington District of Columbia' would equal out to 'Washington D"C'

Now these quotes are going to disqualify the whole TC field and it will not be picked up in the TOC field.

So we have to replace it like this:
Washington D/"C
And then it works.

So I need to scan the selected text before it is inserted by the above macro that I wrote and see if there are quotes in the middle of a word they should be replaced with ' /" ' and only then inserted into the TC field.

This is over my small programming head.

Could you help me?

Thanks again

Susan
Reply With Quote
  #2  
Old 02-08-2024, 08:45 AM
vivka vivka is offline Looking for Macro Windows 7 64bit Looking for Macro Office 2016
Expert
 
Join Date: Jul 2023
Posts: 305
vivka is on a distinguished road
Default

Hi, RRB! The following will do the job:
Code:
Sub Replace_Double_Quotes()

    With selection.range.Find
        .text = "([A-z])" & Chr(34) & "([A-z])"
        .Replacement.text = "\1/" & Chr(34) & "\2"
        .Forward = True
        .Wrap = wdFindStop
        .Format = False
        .MatchWildcards = True
        .MatchSoundsLike = False
        .MatchAllWordForms = False
        .Execute Replace:=wdReplaceAll
    End With
End Sub
If the quotes in the code are not what is needed, find out the ASCII decimal code of the needed quotes and replace '34' with it.
Reply With Quote
  #3  
Old 02-08-2024, 09:13 AM
RRB's Avatar
RRB RRB is offline Looking for Macro Windows 11 Looking for Macro Office 2021
Susan Flamingo
Looking for Macro
 
Join Date: May 2014
Location: The Holy City of Jerusalem
Posts: 301
RRB is on a distinguished road
Default

I am at lack of the correct words to express my gratitude.

Maybe you know about this:
The TOC field as a switch to look within a certain bookmark i.e '\B "BookMarkName". now the rea that I have bookmarked has Footnotes, But I see all the TC fields that are in the FN are not being picked up by the TOC field. When I select the text to apply the BM it doesn't allow me to select ALSO the FN area. So how can INclude the FN area within the giving BM?

Thanks a million!!

Susan
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Perfect macro not working when its code is inserted in larger macro RobiNew Word VBA 3 10-18-2023 03:19 AM
Macro to Remove Paras with Line Spac 6; Macro to Convert Paragraphs to Outline Numbered venganewt Word VBA 0 01-25-2022 06:28 PM
Looking for Macro Footnote extraction macro [Why is this macro so slow? / anyway to make it faster?] Le_Blanc Word VBA 10 03-22-2021 11:38 AM
Spell check macro within macro button field doesn't work in one document samuelle Word VBA 0 07-20-2016 02:27 AM
Looking for Macro Macro Question: Need help making a macro to highlight the first word in every sentence LadyAna Word 1 12-06-2014 10:39 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:46 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