Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
ChrisP ChrisP is offline
external usenet poster
 
Posts: 14
Default References and Bibliographies

I've been using the new citation tools in Word 2007 and was wondering if it
was possible to create separate bibliographies and citation lists.

I would ideally like 2 lists, one with all documents cited (references), the
other will all documents in the sources list not cited (bibliography).

I can create the cited list, but a full bibliography includes these aswell,
meaning they appear twice.

Any help welcomed!
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Yves Dhondt Yves Dhondt is offline
external usenet poster
 
Posts: 767
Default References and Bibliographies

There is no direct way to achieve what you want. If you are lucky enough
that your bibliography is sorted by occurence in the text (numerical
mostly), then the entries that weren't cited in your work will be at the
bottom of the list. Otherwise, you will have to use a workaround.

Using the \f flag on a bibliography field you can display only those entries
that belong to a certain language in your bibliography. So what you can do
is assign a fake language to all your cited works and assign another fake
language to all uncited works. Then you can add 2 different bibliographies
to your work, each one with one of your fake languages.

The following macro automates this process. It will present you with 2
inputboxes. In the first one you will have to enter your language id (1033
is the one for English, for all others see
http://msdn.microsoft.com/en-us/goglobal/bb964664.aspx). In the second, you
will have to enter a number indicating if you want the full bibliography,
only the cited works, or only the uncited works. Once you added a
bibliography of a certain type, you should convert it to static text so that
it can no longer get updated by accident.

Watch for line wraps when copying this macro. For more info on installing
macros, see http://www.gmayor.com/installing_macro.htm

!!! CREATE A BACKUP OF YOUR DOCUMENT BEFORE RUNNING THIS MACRO !!!

==== BEGIN MACRO ====

Sub InsertBibliographyEx()
' Input parameters
Dim bibtype As Integer ' 0 = all, 1 = cited only, 2 = uncited only
Dim locale As String ' LCID code of the entire bibliography

bibtype = 1
locale = "1033"

Do
locale = InputBox("Insert the 4-digit LCID code for your language." & _
vbCrLf & "In case of doubt, enter 0. (1033 = US English)" & vbCrLf & _
"For a full list, see
http://msdn.microsoft.com/en-us/goglobal/bb964664.aspx", _
"LCID value", Application.Language)
Loop While locale 0 Or locale 9999

Do
bibtype = InputBox("Make your choice:" & vbCrLf & " 0 - Display all
sources" & _
vbCrLf & " 1 - Display cited works only" & vbCrLf & " 2 - Display
uncited works only", _
"What do you want to display?", bibtype)
Loop While bibtype 0 Or bibtype 2

' Local constants
Const lcidCited As String = "1117" ' Inuktitut (cited sources)
Const lcidUncited As String = "1098" ' Telugu (uncited sources)

' Local variables.
Dim src As Source
Dim idx As Integer
Dim tags() As String
Dim lcids() As String
Dim size As Integer
Dim code As String

' Init variables.
idx = 1
size = ActiveDocument.Bibliography.Sources.Count
ReDim tags(1 To size)
ReDim lcids(1 To size)

' Generate the code for the field.
If bibtype = 0 Then
code = "BIBLIOGRAPHY \l " + locale
ElseIf bibtype = 1 Then
code = "BIBLIOGRAPHY \l " + locale + " \f " + lcidCited
ElseIf bibtype = 2 Then
code = "BIBLIOGRAPHY \l " + locale + " \f " + lcidUncited
Else
MsgBox "Invalid bibtype specified!", vbExclamation, "Error"
End
End If

' Preprocess all sources in the document.
For Each src In ActiveDocument.Bibliography.Sources
' Make a local copy of the original language setting of a source.
tags(idx) = src.field("Tag")
lcids(idx) = src.field("LCID")
idx = idx + 1

' Set the language of a source according to the fact if it is cited or
not.
If src.Cited = False Then
src.field("LCID") = lcidUncited
Else
src.field("LCID") = lcidCited
End If
Next

' Insert the bibliography field.
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty,
Text:=code, PreserveFormatting:=False
' Update the bibliography field.
Selection.Fields.Update

' Restore the language settings of all the sources.
' (inefficient, a dictionary would be better here)
' (not sure if the collection does not change order, so direct mapping is
a no go)
For Each src In ActiveDocument.Bibliography.Sources
' Locate the position of the tag in the array we stored.
idx = 1
While (src.field("Tag") tags(idx))
idx = idx + 1
Wend

' Use that index to restore the language code
src.field("LCID") = lcids(idx)
Next

End Sub

==== END MACRO ====



"ChrisP" wrote in message
...
I've been using the new citation tools in Word 2007 and was wondering if
it
was possible to create separate bibliographies and citation lists.

I would ideally like 2 lists, one with all documents cited (references),
the
other will all documents in the sources list not cited (bibliography).

I can create the cited list, but a full bibliography includes these
aswell,
meaning they appear twice.

Any help welcomed!


Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
New to bibliographies pen Microsoft Word Help 2 May 27th 09 06:48 AM
Bibliographies tpaul Microsoft Word Help 2 November 18th 08 08:54 PM
combining multiple bibliographies Roswell Microsoft Word Help 2 July 1st 08 04:42 AM
Two needs new features for citations and bibliographies Nick Semenza New Users 0 December 18th 07 11:03 PM
Referencing and Bibliographies Will Flanagan Microsoft Word Help 0 May 27th 06 10:01 AM


All times are GMT +1. The time now is 04:43 AM.

Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"