I need help to add a Vancouver style in word 2013, so I read some previous post but I did not understand this.
Please help with this
Thanks
I upgraded to Office 365 and I can confirm the issue persists in that version.
Word has a context menu for footnotes. Apparently that context menu overwrites the default menu where the 'Edit Field' option is available. You can still use the Word shortcuts to display fields and edit them that way.
Yves,
I'm desperate. I can't find a way around this. Renaming EditUndo doesn't work (it disables Ctrl+Z in Office 365 but doesn't disable the undo stack). I can't get Microsoft to pay attention to this. I've been searching for workarounds but none so far.
So... do you know how the RefOrder value is calculated and set?
I'm thinking of trying to create a macro that effectively does the "Update Citations and Bibliography" function but invoking UndoClear for each citation to burst the bloated undo stack.
If I can update the RefOrder value via a macro I think I will have solved this, but I can't find anything on calculating RefOrder, bearing in mind that one source may have more than one citation in the text.
If it really is the undo stack causing the issue, you could update fields one at a time while constantly truncating the undo stack.
Something like this:
```
Sub UpdateFieldsOneAtATime()
' Changing the style will trigger an update of everything.
' So you should not do this. If really necessary, I would
' do this directly in the open xml of the file (so outside
' Word).
'ActiveDocument.Bibliography.BibliographyStyle = "Nature"
' Define variable.
Dim fld As Field
' Truncate the undo stack.
ActiveDocument.UndoClear
' Process all fields
For Each fld In ActiveDocument.Fields
' Update the in-text citations and truncate the undo stack.
If fld.Type = wdFieldCitation Then
fld.Update
ActiveDocument.UndoClear
End If
' Update the bibliography and truncate the undo stack.
If fld.Type = wdFieldBibliography Then
fld.Update
ActiveDocument.UndoClear
End If
Next
End Sub
```
OK - I was Wrong. It was not the Undo Stack that is bloating and eventually crashing.
When I ran your macro (thanks by the way - it worked perfectly on a test document) word exhibited all the same symptoms as using the application's own "update citations and bibliography" command. It ran for 3 hours and 40 minutes then crashed, with the winword process swelling from 39Mb at the start to about 1.1Gb at the time it crashed. Just like using word's internal command.
What I was able to do with your macro, was to add a statement to save the document at every update:
```
If ActiveDocument.Saved = False Then ActiveDocument.Save
```
I know this will be expensive in execution speed, but not as expensive as a month on this issue with no resolution and 2 years work down the drain. I have tested it on a truncated version of the document (it's slower than molasses) but at least I will be able to figure out how far it got, and maybe manually update the remainder, perhaps. Anyway, even with the many saves, the winword process still bloats in memory. I wonder if they are loading a copy of sources.xml into RAM for every citation?? Whatever Word is doing it is hogging memory and it doesn't scale.
Still no interest from Microsoft.
Thanks a bunch Yves, you have been very helpful. If I ever do get 'proof of life' in Microsoft I'll direct them to this site for other things they need to improve (like XSL handling). Talking of which, is it worth starting a "wish list" and/or a "bug list" for word citations, on this forum, that the community can add to?
OK I set the macro going last night - with the save-as-you-go line in the loop.
About 3h 30 mins in it failed (as expected). I looked at the last-saved file. Word had only processed 308 citations out of about 900 (i would know exactly if I could update the citations!).
The macro was stopped at a file permission error on the ActiveDocument.Save line. The Word window was titled ~WRL3153.tmp. It displayed a dialog saying "The disk is full. Free some space... (etc)" yet I am showing 287Gb free. I searched for ~WRL3153.tmp but it had disappeared. Maybe the temp file grew until it couldn't any more. Perhaps it grew to ?16Gb which I recall is the largest file addressable by a 32 bit app??
Anyway, I had hoped the save-as-you-go approach would get me 80% of the way there, but I' stuck at about 30%. And whatever Word is doing in memory it's even more screwy than I thought.
<openbracket>(</openbracket>
<closebracket>)</closebracket>
into <openbracket></openbracket>
<closebracket></closebracket>
As for adding brackets around the year, you will have to edit the different format strings for all sources.{ %Year|"n.d."{%YearSuffix%}}
would become{ (%Year|"n.d."{%YearSuffix%})}