Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-04-2017, 04:28 PM
Guessed's Avatar
Guessed Guessed is offline Move full stops to other end of a citation Windows 10 Move full stops to other end of a citation Office 2013
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,185
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've done some testing and worked out the find/replace doesn't seem possible so I think a macro solution is going to be required.


Code:
Sub RelocateCitations()
  Dim aFld As Field, aRng As Range
  For Each aFld In ActiveDocument.Fields
    If InStr(1, LCase(aFld.Code), "citation") Then
      Set aRng = aFld.Result
      aRng.Collapse wdCollapseStart
      aRng.MoveEnd Unit:=wdCharacter, Count:=-1   'to get in front of CC
      aRng.MoveStart Unit:=wdCharacter, Count:=-2
      If aRng.Text = ". " Then
        aRng.Text = " "
        Set aRng = aFld.Result
        aRng.Collapse wdCollapseEnd
        aRng.MoveStart Unit:=wdCharacter, Count:=2   'to get after CC
        aRng.InsertAfter "."
      End If
    End If
  Next aFld
End Sub
In my version of Word 2016, the citations are all fields inside Content Controls. The CCs add a level of complexity that require extra lines of code to move the ranges. If your document doesn't also have the CCs then you may need to adjust the macro slightly to work.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #2  
Old 07-04-2017, 05:34 PM
Stefan Blom's Avatar
Stefan Blom Stefan Blom is offline Move full stops to other end of a citation Windows 10 Move full stops to other end of a citation Office 2013
Moderator
 
Join Date: Aug 2011
Posts: 4,049
Stefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to all
Default

Did you get this to work on your system? Here, the asterisk fails to find fields.

Your search expression works just fine when there is ordinary text inside the braces.
__________________
Stefan Blom
Microsoft Word MVP

Microsoft 365 apps for business
Windows 11 Professional
Reply With Quote
  #3  
Old 07-05-2017, 02:58 AM
Macsen Macsen is offline Move full stops to other end of a citation Windows 10 Move full stops to other end of a citation Office 2016
Novice
Move full stops to other end of a citation
 
Join Date: Jun 2017
Location: Wales
Posts: 5
Macsen is on a distinguished road
Default

Brilliant, that seems to have worked like a charm. You've just saved me having to manually delete and insert around 1500 full stops! Thank you very much.

One last questions: Is there a way of making the macro apply to footnotes as well? All the citations in the main body of the document have been changed but those in the footnotes remain the same. Thanks!
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Move full stops to other end of a citation Word 2014: WPerfect 6.x full-justification "stops working" dan_1 Word 12 01-24-2017 12:43 PM
Move full stops to other end of a citation Insert Citation truepharaoh Word 3 12-03-2016 01:35 AM
Move full stops to other end of a citation How to display the full citation in footnotes/endnotes chakyt22 Word 1 09-29-2015 03:37 AM
Move full stops to other end of a citation Why are full stops appearing in between every word I type?? richards_jacqui@sky.com Outlook 1 04-01-2015 10:40 PM
Move full stops to other end of a citation Citation within a Caption Wes Word 1 05-29-2012 10:29 AM

Other Forums: Access Forums

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