Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.tables
Polyanna Polyanna is offline
external usenet poster
 
Posts: 1
Default Export template field information to excel

I have created a word form template with named bookmarks (do they need to
start with bk to be correctly named?).
How do I download information from the documents created from this form into
excel?
I think I use the "save data for forms" checkbox but then what?

  #2   Report Post  
Posted to microsoft.public.word.tables
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Export template field information to excel

The following is some code that runs from Access to extract information from
FormFields in all of the Word documents stored in a particular folder and
inserts it into a table in Access. You may be able to modify it to do the
same thing with Excel.

Dim dbsAQS As Database
Dim rstAQS As Recordset
Dim wordApp As Object
Dim vAuthor As String
Dim vWorkingTitle As String
Dim vStreet As String
Dim vCity As String
Dim vState As String
Dim vZip As String
Dim vPhone As String
Dim vEmail As String
Dim vWebsite As String
Dim vDateSubmitted As String
Dim vTopic As String
Dim vFormat As String
Dim vSlides As String
Dim vTransparencies As String
Dim vPhotos As String
Dim vLineDrawings As String
Dim vAuthorPhoto As String
Dim vOtherVisuals As String
Dim vSASE As String
Dim FldrPath As String
Dim RecordDoc As String
Dim Source As Object
Dim i As Long
Dim Filetokill As String

FldrPath = "C:\AQS\"

Set dbsAQS = OpenDatabase(FldrPath & "AQS.mdb")
Set rstAQS = dbsAQS.OpenRecordset("tblSources", dbOpenDynaset)

On Error GoTo CreateWordApp
Set wordApp = GetObject(, "Word.Application")
wordApp.Visible = False
On Error Resume Next



RecordDoc = Dir$(FldrPath & "*.doc")

i = 0
While RecordDoc ""
Set Source = wordApp.Documents.Open(FldrPath & RecordDoc)
vAuthor = Source.FormFields("Author").result
vWorkingTitle = Source.FormFields("WorkingTitle").result
vStreet = Source.FormFields("Street").result
vCity = Source.FormFields("City").result
vState = Source.FormFields("State").result
vZip = Source.FormFields("Zip").result
vPhone = Source.FormFields("Phone").result
vEmail = Source.FormFields("Email").result
vWebsite = Source.FormFields("Website").result
vDateSubmitted = Source.FormFields("DateSubmitted").result
vTopic = Source.FormFields("Topic").result
vFormat = Source.FormFields("Format").result
vSlides = Source.FormFields("Slides").result
vTransparencies = Source.FormFields("Transparencies").result
vPhotos = Source.FormFields("Photos").result
vLineDrawings = Source.FormFields("LineDrawings").result
vAuthorPhoto = Source.FormFields("AuthorPhoto").result
vOtherVisuals = Source.FormFields("OtherVisuals").result
vSASE = Source.FormFields("SASE").result
Filetokill = FldrPath & Source
Source.SaveAs FldrPath & "Processed\" & vAuthor
Source.Close wdDoNotSaveChanges
Kill Filetokill
With rstAQS
.AddNew
If vAuthor "" Then !Author = vAuthor
If vWorkingTitle "" Then !WorkingTitle = vWorkingTitle
If vStreet "" Then !Street = vStreet
If vCity "" Then !City = vCity
If vState "" Then !State = vState
If vZip "" Then !Zip = vZip
If vPhone "" Then !Phone = vPhone
If vEmail "" Then !Email = vEmail
If vWebsite "" Then !Website = vWebsite
If vDateSubmitted "" Then !DateSubmitted = vDateSubmitted
If vTopic "" Then !Topic = vTopic
If vFormat "" Then !Format = vFormat
If vSlides "" Then !Slides = Val(vSlides)
If vTransparencies "" Then !Transparencies = Val(vTransparencies)
If vPhotos "" Then !Photos = Val(vPhotos)
If vLineDrawings "" Then !LineDrawings = Val(vLineDrawings)
If vAuthorPhoto "" Then !AuthorPhoto = Val(vAuthorPhoto)
If vOtherVisuals "" Then !OtherVisuals = Val(vOtherVisuals)
If vSASE "" Then !SASE = Val(vSASE)
.Update
End With
i = i + 1

RecordDoc = Dir
Wend

MsgBox i & " Records Added."

Set wordApp = Nothing
Set WordDoc = Nothing

CreateWordApp:
Set wordApp = CreateObject("Word.Application")
Resume Next



--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"Polyanna" wrote in message
...
I have created a word form template with named bookmarks (do they need to
start with bk to be correctly named?).
How do I download information from the documents created from this form
into
excel?
I think I use the "save data for forms" checkbox but then what?



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
export data to Excel Nancy Newburger New Users 3 August 8th 07 06:54 AM
can I export information from excel into mail merge for labeling? Wendy Mailmerge 1 July 13th 06 10:34 PM
Can I export information from Windows Address Book 6.0 to Word 200 Al O'Reilly Mailmerge 1 December 2nd 05 01:35 PM
How do I export a Word document summary information? bbriell Microsoft Word Help 1 May 17th 05 05:12 PM
Export .doc file into Excel 19Slade52 Tables 1 January 24th 05 11:46 PM


All times are GMT +1. The time now is 08:39 PM.

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

About Us

"It's about Microsoft Word"