Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-25-2014, 09:50 AM
cliffoth cliffoth is offline Word Forms - importing data from one form to another Windows 7 64bit Word Forms - importing data from one form to another Office 2010 64bit
Novice
Word Forms - importing data from one form to another
 
Join Date: Sep 2014
Posts: 4
cliffoth is on a distinguished road
Default Word Forms - importing data from one form to another

Hello all - I have a MS Word form that has been in use for several years, but changes slightly each year with small changes in wording, added content, etc. Because of these changes, a "Save As" won't work.



Is there any way to import data entered on last year's form to this year's form within Word? The solution needs to be fairly simple, as it will need to be utilized by pretty basic users in order to be useful.

Thanks in advance for your assistance!
Reply With Quote
  #2  
Old 09-25-2014, 02:24 PM
macropod's Avatar
macropod macropod is offline Word Forms - importing data from one form to another Windows 7 64bit Word Forms - importing data from one form to another Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

What are you trying to import?
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 09-25-2014, 02:30 PM
cliffoth cliffoth is offline Word Forms - importing data from one form to another Windows 7 64bit Word Forms - importing data from one form to another Office 2010 64bit
Novice
Word Forms - importing data from one form to another
 
Join Date: Sep 2014
Posts: 4
cliffoth is on a distinguished road
Default

I am trying to find a way for users to import or copy the data completed on the form from last year onto this year's form. This is about a 20 page document (protected, fillable form in MS Word) and approximately 80% of the data is the same from year to year, but users are manually needing to re-type/re-key the same information from year to year because the form changes slightly. We do literally hundreds of these documents a month and these are high paid clinicians, so it would be a major timesaver/$$ saved.

I have searched this and other online forums but have not found an answer to this issue. It feels like something that should be able to be accomplished, but is above my knowledge/skill level. We are able to do this with forms in Adobe PDF on a regular basis using the import/export function even if the form has slight edits/changes from time to time.
Reply With Quote
  #4  
Old 09-25-2014, 02:54 PM
macropod's Avatar
macropod macropod is offline Word Forms - importing data from one form to another Windows 7 64bit Word Forms - importing data from one form to another Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

OK, so it seems you're using formfields. Are they always the same set of formfields and are all the formfields in the same order between the two documents (including none being added/deleted)?
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 09-25-2014, 03:25 PM
cliffoth cliffoth is offline Word Forms - importing data from one form to another Windows 7 64bit Word Forms - importing data from one form to another Office 2010 64bit
Novice
Word Forms - importing data from one form to another
 
Join Date: Sep 2014
Posts: 4
cliffoth is on a distinguished road
Default

There are some minor changes to the form fields from year to year which is the barrier. Even if there was a way to transfer a lot or even some of the data, it would be hugely helpful. The majority is the same, but we have required changes that are unpredictable from year to year.
Reply With Quote
  #6  
Old 09-25-2014, 03:36 PM
macropod's Avatar
macropod macropod is offline Word Forms - importing data from one form to another Windows 7 64bit Word Forms - importing data from one form to another Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

In that case, do the formfields with the data to be transferred use the same bookmark names in both documents? If not, you probably need to set them up that way. Otherwise any automated data transfer would be just too hit & miss.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #7  
Old 09-25-2014, 04:09 PM
cliffoth cliffoth is offline Word Forms - importing data from one form to another Windows 7 64bit Word Forms - importing data from one form to another Office 2010 64bit
Novice
Word Forms - importing data from one form to another
 
Join Date: Sep 2014
Posts: 4
cliffoth is on a distinguished road
Default

Yes they do have the same bookmark names, thanks again for your help!
Reply With Quote
  #8  
Old 09-25-2014, 05:17 PM
macropod's Avatar
macropod macropod is offline Word Forms - importing data from one form to another Windows 7 64bit Word Forms - importing data from one form to another Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Try the following macro. It allows the user to select a single new form to use as a template for the output files, then an output folder, then all the source files from which the data are to be transferred. A new output document is created in the output folder with the same name as each of the source files. Output files are saved in the .docx format.
Code:
Sub DataReplication()
Dim NewFile As Variant, OldFile As Variant, StrFoldr As String
Dim DocSrc As Document, DocTgt As Document, FmFld As FormField
With Application.FileDialog(msoFileDialogFilePicker)
  .Title = "Please select the new form"
  .AllowMultiSelect = False
  .Filters.Add "Documents & Templates", "*.doc*; *.docx; *.dot*", 1
  'use Show method to display File Picker dialog box and return user's action
  If .Show = -1 Then
    NewFile = .SelectedItems(1)
  Else
    Exit Sub
  End If
End With
StrFoldr = GetFolder(Title:="Select the Destination Folder", RootFolder:="C:\Users\" & Environ("UserName"))
If StrFoldr = "" Then Exit Sub
With Application.FileDialog(msoFileDialogFilePicker)
  .Title = "Please select the old documents"
  .AllowMultiSelect = True
  .Filters.Add "Documents", "*.doc; *.docx", 1
  'use Show method to display File Picker dialog box and return user's action
  If .Show = -1 Then
    'step through each item in the collection
    For Each OldFile In .SelectedItems
      Set DocTgt = Documents.Add(NewFile, Visible:=False)
      Set DocSrc = Documents.Open(OldFile, AddToRecentFiles:=False, Visible:=False)
      With DocTgt
        For Each FmFld In .FormFields
          FmFld.Result = DocSrc.FormFields(FmFld.Name).Result
        Next
        .SaveAs StrFoldr & "\" & Split(DocSrc.Name, ".")(0) & ".docx", FileFormat:=wdFormatXMLDocument, AddToRecentFiles:=False
        .Close False
      End With
      DocSrc.Close False
    Next
  Else
    Exit Sub
  End If
End With
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
importing Access data to a Word document WayneCusack Word VBA 2 12-24-2012 12:26 AM
Print word form using excel data sheet LS1015 Office 1 07-16-2012 08:16 PM
word form data Jasafras2 Word VBA 1 05-27-2011 03:12 PM
*Big One* feeding sql server data into MS Word 2007 forms vafo Mail Merge 0 02-03-2010 04:49 AM
Word Forms - importing data from one form to another Forms - linked form boxes m.beharry Word 2 07-03-2009 09:12 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:08 PM.


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