Results 1 to 4 of 4
  1. #1
    vidhya is offline Novice
    Windows 10 Access 2016
    Join Date
    Nov 2015
    Posts
    2

    How to insert values to the bibliography fields programmatically using VBA word?

    Am in the process of automating the conversion of unedited bibliographies to structured bibliographies with specific style(APA, AMA etc).

    Using MS word, under reference tab in the manage source dialog box , we should fill up the bibliography fields manually(For example: author,title,year). This will create the `sources.xml` with all the values in it.

    Now how I want to automate is,

    Example:

    Blum, R., & Dick, B. (2013). Strengthening global programs and science for youth based on
    emerging science. Journal of Adolescent Health, 52, s1-s3. doi:10.1016/jadohealth.2012.11.004

    I want to seperate author name, year,title,publisher etc from the bibliography and insert it in to the sources.xml

    Example(Sources.xml):

    <?xml version="1.0"?>
    -<b:Sources xmlns="http://schemas.openxmlformats.org/officeDocument/2006/bibliography" xmlns:b="http://schemas.openxmlformats.org/officeDocument/2006/bibliography" SelectedStyle="">
    -<b:Source>
    <b:Tag>kra07</b:Tag>
    <b:SourceType>JournalArticle</b:SourceType>
    -<b:Author>
    -<b:Author>
    -<b:NameList>
    -<b:Person>
    <b:Last>kramer</b:Last>
    </b:Person>
    </b:NameList>
    </b:Author>
    </b:Author>
    <b:Title>biblography</b:Title>
    <b:JournalName>adventure</b:JournalName>
    <b:Year>2006</b:Year>
    <b:Pages>50-62</b:Pages>
    </b:Source>
    </b:Sources>

    To add the values I can use Application.Bibliography.Sources.Add stringXml. Now how can I seperate these fields from unedited references and insert it into source xml?



    Am thinking to put delimiter manually to seperate fields. Will that be possible?

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Offhand, I would say yes. The delimiter would have to be a character guaranteed not used elsewhere in string.

    But why are these distinct data all saved into one field to begin with? Concatenating text is easier than splitting text.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    vidhya is offline Novice
    Windows 10 Access 2016
    Join Date
    Nov 2015
    Posts
    2
    Concatenating text? Sorry I couldn't get it clearly. I have unedited bibiographies strings. My goal is to get it in APA style programmatically. So for that, I need to seperate all the fields from each references and add it into the source.xml from that I could get APA style .

    So now, what would be the effective way to seperate the text?

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Separating will probably require VBA custom function. But if there are no identifiers (delimiting characters) embedded in the string, then this would be virtually impossible. If the distinct data were saved into separate fields as they should be then this would not be an issue.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 9
    Last Post: 09-18-2015, 09:02 PM
  2. Replies: 6
    Last Post: 04-24-2014, 10:48 PM
  3. Call word object and import word fields
    By silverspr in forum Programming
    Replies: 3
    Last Post: 12-10-2012, 11:32 PM
  4. Replies: 3
    Last Post: 01-05-2012, 10:47 AM
  5. Replies: 0
    Last Post: 03-08-2011, 05:56 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums