Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #22  
Old 01-11-2014, 04:51 AM
macropod's Avatar
macropod macropod is offline Extract form fields to Word Document Windows 7 32bit Extract form fields to Word Document Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
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

That suggests the document to which this applies might not be the first one to be opened. Allowing for that possibility -

On the end of:
Dim StrFlds As String, i As Long
add:
, Rng As Range

After:
Set wdTgtDoc = ActiveDocument
insert:
Set Rng = wdTgtDoc.Characters.Last

Change:
wdTgtDoc.Range.InsertAfter .FormFields(4).Result & vbCr
to:
Code:
    If .Name = "Form1.doc" Then
      Rng.InsertBefore .FormFields(1).Result & vbCr & .FormFields(4).Result & vbCr
    Else
      wdTgtDoc.Range.InsertAfter .FormFields(4).Result & vbCr
    End If
and replace "Form1.doc" with whatever the document's name should be.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Inserting spreadsheet data rows as form fields in a document b3nz Word 3 03-31-2013 07:47 PM
Form Fields in Word jwm1346 Word 1 04-17-2012 07:02 PM
Extract form fields to Word Document Issues with Microsoft Word Form Fields hbforsyth Word 9 11-14-2011 04:26 PM
Calculating Form Fields in Microsoft Word wubba80 Word 1 06-25-2010 12:42 AM
Form fields in Word messed up mba Word VBA 0 02-07-2010 09:54 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:36 AM.


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