📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!

Complicated Microsoft word question it might be impossible

2»

Comments

  • Alderbank said:
    I assume the non-English characters only occur in these special locations? If so,do a wildcard Find and Replace
    Your “Find What” text needs to be:
    (Æ)(*)(Ö)
    That gives you three separate blocks of text which in Word shorthand are \1, \2 and \3. You just want the middle block so your Replace with text needs to be:
    \2
    And in the “Replace with:” box, select Format + Font + Italic

    This works for me. Let us know if it works for you!
    Thank you so much.
    I would like to do something similar
    I.e change

    Example Text


    to 

    ÆExample TextÖ


    Do you know how to do that?


  • Alderbank
    Alderbank Posts: 4,019 Forumite
    Eighth Anniversary 1,000 Posts Name Dropper
    In Find put Example Text. From dropdown box select 'Find whole words only'.

    In Replace with put ÆExample TextÖ

    This will change the whole phrase 
    Example Text, but not the single words Example or Text if they occur separately.

    Is that what you want?
  • Alderbank said:
    In Find put Example Text. From dropdown box select 'Find whole words only'.

    In Replace with put ÆExample TextÖ

    This will change the whole phrase Example Text, but not the single words Example or Text if they occur separately.

    Is that what you want?
    Thank you that is what I asked, unfortunately due to poor communication on my part. It is not exactly what I wanted.

    I should have said that the text would change i.e so it would change something like this

     

    Example Text

    Wordsintitaics

    More words completely different from the previous examples

    All text in italics

     To

     

    ÆExample TextÖ

    ÆWordsintitaicsÖ

    ÆMore words completely different from the previous examplesÖ

    ÆAll text in italicsÖ


    However there would be 100+ examples.
    Does that make sense? Thanks again.


  • Alderbank
    Alderbank Posts: 4,019 Forumite
    Eighth Anniversary 1,000 Posts Name Dropper
    edited 9 October 2023 at 4:14PM
    Sorry, it doesn't make any sense to me but I'm sure others might be able to figure out what you want.

    You could be searching for some kind of mail merge where your hundreds of examples are in the form of a list or in fields but that may be beyond your present abilities with Word.

    Have you considered doing a course in MSWord?

    There are lots and lots including free ones online. I'm sure you would benefit and you will be amazed at what you and Word could do together.
  • GDB2222
    GDB2222 Posts: 26,364 Forumite
    Part of the Furniture 10,000 Posts Photogenic Name Dropper
    If you often run into issues like this, you may want to spend a bit of time learning VBA.
    No reliance should be placed on the above! Absolutely none, do you hear?
  • Alderbank
    Alderbank Posts: 4,019 Forumite
    Eighth Anniversary 1,000 Posts Name Dropper
    I agree with @GDB2222's post above. ^^^

    If I am right about what you are looking for, this macro posted in Superuser could be adapted to do what you want but it does require that programming knowledge

    Using a list in excel to replace words in a word document 
    https://superuser.com/questions/1476515/using-a-list-in-excel-to-replace-words-in-a-word-document-need-to-select-and-p
  • Heedtheadvice
    Heedtheadvice Posts: 2,781 Forumite
    Part of the Furniture 1,000 Posts Name Dropper
    It does seem that you might be making  thing complicated using  those characters....or possibly not if you are using them to delineate sections for actions!
    As writ above some of the complicated things can be easy with VBA programming but that is quite advanced.

    It might be a good idea to explain what you are doing what your aim is and why those characters are involved as sometimes you can go down a path that makes things over complicated....
  • I have found a fix using python from a friend


    import docx 
     
    # Opening MS word document
    doc_name ='test.docx'
    doc = docx.Document(doc_name) 
     
    #Filtering iltalicized text 
    Italic_Text = '' 
    for p in doc.paragraphs: 
        for run in p.runs: 
            if run.italic: 
                Italic_Text = Italic_Text + run.text + " " 
                #print (run.text)
                run.text ='Æ ' + run.text +' Ö'
                #print (run.text)
    #Splitting text to a list of words 
    Italic_Words =list(filter(None,Italic_Text.split(' '))) 
     
    #Counting the number of italicized words 
    counter = len(Italic_Words) 
    print ("The number of Italic words is", str(counter))
    doc.save('doc_name') 


    Very easy thank you all for your help.
Meet your Ambassadors

🚀 Getting Started

Hi new member!

Our Getting Started Guide will help you get the most out of the Forum

Categories

  • All Categories
  • 351.6K Banking & Borrowing
  • 253.3K Reduce Debt & Boost Income
  • 453.9K Spending & Discounts
  • 244.6K Work, Benefits & Business
  • 599.9K Mortgages, Homes & Bills
  • 177.2K Life & Family
  • 258.2K Travel & Transport
  • 1.5M Hobbies & Leisure
  • 16.2K Discuss & Feedback
  • 37.6K Read-Only Boards

Is this how you want to be seen?

We see you are using a default avatar. It takes only a few seconds to pick a picture.