Consulting

Results 1 to 3 of 3

Thread: Change Bibiliography Style with VBA

  1. #1
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,726
    Location

    Change Bibiliography Style with VBA

    Is there any way to change the bibliography style with VBA, say from APA to MLA?

    Capture.JPG

    The macro recorder just records an empty macro


    Edit -- Inside the docx in customXml\item1.xml …

    Capture.JPG

    … I found a reference to the bibliographic style in XML, but I have no idea how to edit it
    Last edited by Paul_Hossler; 08-18-2018 at 11:17 AM.
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  2. #2
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    4,435
    Location
    You should be able to do it with code like:
    ActiveDocument.Bibliography.BibliographyStyle = "MLA Seventh Edition"
    Cheers
    Paul Edstein
    [Fmr MS MVP - Word]

  3. #3
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,726
    Location
    Thanks

    The macro recorder didn't give me anything

    Using the Watch Window and knowing what to look for, I could see the properties

    MUCH easier than trying to mess with the CustomXml

    Thanks again
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •