Macro for converting Citations to Static text?

G

grammatim

In order to approximate Chicago style in Word2007, I find that I need
to use "Chicago" for the in-text citations (which gets me "(name date,
page)" -- and then where necessary I can manually edit it to "name
(date, page)" -- but "Chicago" style for bibliographies is seriously
broken, so I need to use "APA" in order to get the date directly after
the author, and to get the volume editors and volume number of an
edited book in approximately correct positions. I can then convert the
bibliography to static text in order to sort the entries (they appear
within each author alphabetically by title instead of in date order).

Thus, after the document is finished, I need to set References to
"Chicago" and convert the citations to static text (to be able to keep
the format and to move the parentheses where necessary). ("APA" gives
"(name, date, p. page)".) But this can't be automated with Find/
Replace; there is no way to put "Convert to Static Text" into the
Replace box. So this is what I hope a macro can be made to do. It
seems like it ought to be a very simple Find and Act sequence.

(Then, after there are no more linked Citations, I change the
Reference style to "APA" and change the bibliography to Static Text in
order to do the sort, to insert the 3-em dashes for repeated author
name, to restore authors' first names, to deitalicize the journal
volume number (why does "APA" put spaces before the commas?), and
within a Book Section reference to move the volume editors after the
edited volume title.)

Important discovery: If the same author's name is typed in one
reference directly into the "Author" box on the New Sources panel, and
in another using the "Edit" button next to that box, Word does not
recognize them as the same person. Authors shouild thus always be
entered using the "Edit" button (since for multiple authors you need
to use it anyway).

I also once discovered that one of the listed styles will include the
"Comments" in the bibliography entry -- that's where I put Book Series
information, which is very important but not provided for at all by
Word -- but otherwise it was not compatible with Chicago style.
 
G

grammatim

It works in the main text, but it doesn't affect footnotes (even if
the cursor is placed at the beginning of note 1, or on a Citation).
 
Y

Yves Dhondt

Footnotes are in a different story than the main text. Just loop over the
different stories to handle them as well.

Sub CitationsToStaticText()
Dim fld As Field

For Each sr In ActiveDocument.StoryRanges
' Find all citation fields and convert them to static text.
For Each fld In sr.Fields
If fld.Type = wdFieldCitation Then
fld.Select
WordBasic.BibliographyCitationToText
End If
Next
Next

End Sub

Yves
 
G

grammatim

I don't know what "loop over the different stories" means. Clicking
the macro button while in a footnote results in no action. (In the
main text, the action was just slow enough to see it happen to each
entry.)

Are you saying to replace the existing macro text with the text below?
 
Y

Yves Dhondt

Yes replace it.

A Word document consists of different 'layers', called stories. You have
separate ones for the main document, headers, footers, footnotes, endnotes,
textframes, ...

In the first macro, ActiveDocument.Fields would only list the fields in the
main story, not those you put in the footnotes or endnotes. Going over each
story, as the new macro does, should solve the problem.

Yves

I don't know what "loop over the different stories" means. Clicking
the macro button while in a footnote results in no action. (In the
main text, the action was just slow enough to see it happen to each
entry.)

Are you saying to replace the existing macro text with the text below?
 
G

grammatim

Thank you ... I won't be able to test it until the next time I finish
an article, which will be a while.

If the old one works on one story at a time, why doesn't it work on
the footnotes story when I'm in the footnotes? Various operations need
to be repeated in the footnotes after being done in the main text
(such as Find/Replace), so why shouldn't this one work the same way?
 
Y

Yves Dhondt

Because it doesn't focus on a specific story but rather just takes
"ActiveDocument.Fields" which is the main story. So even when in the
footnotes, I would try to convert the ones in the main text.

Yves

Thank you ... I won't be able to test it until the next time I finish
an article, which will be a while.

If the old one works on one story at a time, why doesn't it work on
the footnotes story when I'm in the footnotes? Various operations need
to be repeated in the footnotes after being done in the main text
(such as Find/Replace), so why shouldn't this one work the same way?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top