Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-08-2015, 09:42 AM
jbaranao jbaranao is offline Windows Vista Office 2007
Novice
 
Join Date: Feb 2015
Posts: 2
jbaranao is on a distinguished road
Question Create footnotes from table... ¿AUTOMATICALLY?

Hi

I have a database with 3200 lines. Each one has a title, a content and a REFERENCE field. I must export it to MS Word, so I wonder whether it is possible to somehow transform automatically the reference field into a footnote or an endnote. Of course, to start I can easily export the database to an Excel or Word table.



I would really appreciate any help

Greetings from Chile!
Reply With Quote
  #2  
Old 02-08-2015, 02:06 PM
Guessed's Avatar
Guessed Guessed is offline Windows 7 32bit Office 2010 32bit
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,977
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

It might be possible with a mail merge but probably not so I think you will need a macro to export two fields to the page and one field to a footnote/endnote.

If you provide some sample data which shows the fields then perhaps someone here will write the code you need. It probably would be easiest to code if you put the sample data into either Excel or a Word table and show the look you want to achieve with the Title and Content fields.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #3  
Old 02-08-2015, 04:19 PM
jbaranao jbaranao is offline Windows Vista Office 2007
Novice
 
Join Date: Feb 2015
Posts: 2
jbaranao is on a distinguished road
Default

Hi!

Here I attach the Excel file with a sample and the MS Word file of the desired output.

If it was possible to provide an style for the field "Title" (for example, "Title 2", as in the exmaple) it would be even better and I would be even more grateful!
Reply With Quote
  #4  
Old 02-08-2015, 08:57 PM
Guessed's Avatar
Guessed Guessed is offline Windows 7 32bit Office 2010 32bit
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,977
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

If you put this macro into your Excel workbook then it will create the Word document for you. Note that you need to add a Reference to the Word Object Library

Code:
Sub SendDataToWord()
  Dim appWord As Word.Application 'need reference to Microsoft Word x.x Object Library
  Dim docWord As Word.Document, rngDoc As Word.Range
  Dim paraWord As Word.Paragraph
  Dim rng As Excel.Range
  Dim i As Integer
  
  Set rng = ActiveSheet.UsedRange
  
  Set appWord = New Word.Application    'Create new instance of Word:
  appWord.Visible = True                'make the Word window visible:
  Set docWord = appWord.Documents.Add   'add a new word document:
  
  For i = 2 To rng.Rows.Count
    Set rngDoc = docWord.Content
    rngDoc.InsertParagraphAfter
    rngDoc.Collapse Direction:=wdCollapseEnd
    rngDoc.Text = rng.Cells(i, 1) & vbCr
    rngDoc.InsertAfter rng.Cells(i, 2)
    rngDoc.Style = "Normal"
    rngDoc.Paragraphs(1).Range.Style = "Heading 2"
    rngDoc.Collapse Direction:=wdCollapseEnd
    docWord.Endnotes.Add Range:=rngDoc, Text:=rng.Cells(i, 3).Text
  Next
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
Reply

Tags
endnotes, footnotes



Similar Threads
Thread Thread Starter Forum Replies Last Post
I want to create footnotes without numbers j hewitt Word 1 01-05-2015 10:26 AM
Automatically updating cross-references in Footnotes jessy_33 Word 1 05-07-2014 02:45 PM
create footnotes from custom text mosrozen Word VBA 2 06-14-2012 06:59 AM
Can Word automatically update footnotes? gib65 Word 2 08-15-2011 01:46 PM
automatically extract footnotes into new file and apply character format to footnote hrdwa Word 0 02-27-2010 03:16 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:27 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft