Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-25-2020, 09:12 AM
busy_sample busy_sample is offline Select everything not inside quotations Windows 10 Select everything not inside quotations Office 2013
Novice
Select everything not inside quotations
 
Join Date: Aug 2020
Posts: 4
busy_sample is on a distinguished road
Default Select everything not inside quotations

Hi, thanks for having this forum. I have a rather long document with a lot of dialogue. I would like to change it from present tense to past tense. I know I can find and replace words like 'is' with 'was' and change word tense, but I don't want that to happen inside the dialogue. (It makes it pretty much gibberish)



Is there a way to select what's not inside dialogue, then change the tense?

Any help is appreciated. Thank you!
Reply With Quote
  #2  
Old 08-25-2020, 10:25 PM
gmayor's Avatar
gmayor gmayor is offline Select everything not inside quotations Windows 10 Select everything not inside quotations Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

That's a tall order. Working with a COPY of the document, I would be inclined to use replace to find the quoted sections and highlight them. Then I would create a macro to find the words you want to replace and ignore the replacement if the text is highlighted. Then remove the highlight.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #3  
Old 08-26-2020, 06:21 AM
busy_sample busy_sample is offline Select everything not inside quotations Windows 10 Select everything not inside quotations Office 2013
Novice
Select everything not inside quotations
 
Join Date: Aug 2020
Posts: 4
busy_sample is on a distinguished road
Default

That sounds like it would work, but I have no idea how to do that. Do you have any suggestions?
I've spent at least eight hours doing find/replace then going back to the dialogue and changing it back, but I'm only on page five out of over 300. It will take me as long to fix it as it did to write it.
Reply With Quote
  #4  
Old 08-26-2020, 03:48 PM
Guessed's Avatar
Guessed Guessed is online now Select everything not inside quotations Windows 10 Select everything not inside quotations Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,969
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

The dialog part of your request is not particularly difficult but I can't get my head around the hard part of changing tense. Do you have an automated way of doing that?

If we can understand your method for changing tense, we can suggest how to isolate the dialog from that method.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #5  
Old 08-26-2020, 05:56 PM
busy_sample busy_sample is offline Select everything not inside quotations Windows 10 Select everything not inside quotations Office 2013
Novice
Select everything not inside quotations
 
Join Date: Aug 2020
Posts: 4
busy_sample is on a distinguished road
Default

No, I basically just do Control + F for like space is space then replace with space was space then just do like search for like takes and replace with took or creeps with crept, etc. it takes a long time, but I think if I can get the dialogue not to change, it might be easier. There is a lot of dialogue and it ends up completely gibberish.

I've worked with a couple excel macros before, but it was just recording what I did on the screen. If I had an editable macro I could keep putting words in it I come across? Any help is appreciated.
Reply With Quote
  #6  
Old 08-26-2020, 06:42 PM
Guessed's Avatar
Guessed Guessed is online now Select everything not inside quotations Windows 10 Select everything not inside quotations Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,969
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

I'm not convinced that doing global searches outside of the quotes is not going to result in gibberish but it is worth a try.

I would start by building a list with the search terms followed by their replace terms
is was
run ran
creep crept
do did

I can't do a macro right now but if you want to supply a larger list of terms with a sample of your document content then I can have a look at it tomorrow or over the weekend.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #7  
Old 08-26-2020, 11:30 PM
eNGiNe eNGiNe is offline Select everything not inside quotations Windows 7 32bit Select everything not inside quotations Office 2010 64bit
Expert
 
Join Date: Jan 2012
Location: Brussels [BE]
Posts: 746
eNGiNe is on a distinguished road
Default

background speculation: would using a separate paragraph style for dialogue make it easier to restrict the scope of search/replace?
Reply With Quote
  #8  
Old 08-27-2020, 12:44 AM
gmayor's Avatar
gmayor gmayor is offline Select everything not inside quotations Windows 10 Select everything not inside quotations Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

The following should do the trick. Create a new document with a two column table (no header row). Put the words to find in the left column, their replacements in the right column. Save it in your My Documents folder as Changes.docx and close it. Then run the following macro on your COPY document. Th macro assumes that your document has straight quotes. If it has English smart quotes then replace
Code:
Chr(34) & "*" & Chr(34)
with
Code:
Chr(147) & "*" & Chr(148)
Code:
Sub ReplaceFromTable()
Dim oChanges As Document, oTarget As Document
Dim oTable As Table
Dim oldpart As Range, newpart As Range
Dim oRng As Range
Dim i As Long
    Set oTarget = ActiveDocument
    Set oRng = oTarget.Range
    With oRng.Find
        'find quoted text, assumes straight quotes are used
        Do While .Execute(findText:=Chr(34) & "*" & Chr(34), MatchWildcards:=True)
            oRng.HighlightColorIndex = wdTurquoise
            oRng.Collapse 0
        Loop
    End With

    'table document (changes.docx)from  My Documents folder
    Set oChanges = Documents.Open(Environ("USERPROFILE") & "\Documents\changes.docx")
    Set oTable = oChanges.Tables(1)
    For i = 1 To oTable.Rows.Count
        Set oRng = oTarget.Range
        Set oldpart = oTable.Cell(i, 1).Range
        oldpart.End = oldpart.End - 1
        Set newpart = oTable.Cell(i, 2).Range
        newpart.End = newpart.End - 1
        With oRng.Find
            Do While .Execute(findText:=oldpart)
                If Not oRng.HighlightColorIndex = wdTurquoise Then
                    oRng.FormattedText = newpart.FormattedText
                End If
                oRng.Collapse wdCollapseEnd
            Loop
        End With
    Next i
    oChanges.Close wdDoNotSaveChanges
    oTarget.Range.HighlightColorIndex = wdNoHighlight
lbl_Exit:
    Set oRng = Nothing
    Set oTarget = Nothing
    Set oChanges = Nothing
    Set oTable = Nothing
    Exit Sub
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com

Last edited by gmayor; 08-27-2020 at 08:48 PM.
Reply With Quote
  #9  
Old 08-27-2020, 12:54 AM
Guessed's Avatar
Guessed Guessed is online now Select everything not inside quotations Windows 10 Select everything not inside quotations Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,969
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Bravo on the code Graham, I haven't tested it but I'm pleased someone else had a go at it first.

I was thinking it would be better to tag the dialog with a character style and then apply highlights to the words that get changed - I reckon I would want to review a lot of the changes before I would be confident that you can simply change the tense of individual words without ruining the content.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #10  
Old 08-27-2020, 02:28 AM
gmayor's Avatar
gmayor gmayor is offline Select everything not inside quotations Windows 10 Select everything not inside quotations Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Quote:
Originally Posted by Guessed View Post
I reckon I would want to review a lot of the changes before I would be confident that you can simply change the tense of individual words without ruining the content.
I agree, but it's starting point and the intrusion in a large document of the confirmations would soon become tedious. Putting on my hat as a former journalist, I think I would prefer to proof read it after the bulk changes. There is no simple silver bullet for a job like this.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #11  
Old 08-27-2020, 05:48 AM
busy_sample busy_sample is offline Select everything not inside quotations Windows 10 Select everything not inside quotations Office 2013
Novice
Select everything not inside quotations
 
Join Date: Aug 2020
Posts: 4
busy_sample is on a distinguished road
Default

Hi, guys, thank you both tons. Yes, it will still require proofread and editing but I hope this will reduce the time for that. I'll give it a go :-) Glad I came here, and thanks again!
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to apply a style between quotations WVA Word VBA 6 07-30-2019 11:13 AM
How to superscript inside a fraction? Xifortis Word 1 12-20-2018 11:42 AM
Select everything not inside quotations Header on Top Of Listbox( Not Inside) charlesdh Excel Programming 2 08-30-2018 01:45 PM
Text inside text boxes create headings inside my table of contents!!! How do I delete the created he carstj Word 3 04-11-2016 12:46 PM
How can you add arrows inside tables? canthelp Word 4 11-03-2015 10:48 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:38 PM.


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