Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Smhall Smhall is offline
external usenet poster
 
Posts: 9
Default Protect form fields in merged files

Using the information from the amazing MVPs, I have created a document that
merges excel data into a document with form fields(that spell checks!!!).
I'm stuck on one last piece of the puzzle. I am trying to split the merged
document into individual files using a merge field as the user name. If the
merged document has the form proctection turned off, it works, but then all
the new documents are unprocted as well. Is there a way to keep the form
protection in my new documents?

  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Protect form fields in merged files

After you create each individual document, use the command to protect it.

ActiveDocument.Protect wdAllowOnlyFormFields, NoReset

--
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

"Smhall" wrote in message
...
Using the information from the amazing MVPs, I have created a document
that
merges excel data into a document with form fields(that spell checks!!!).
I'm stuck on one last piece of the puzzle. I am trying to split the
merged
document into individual files using a merge field as the user name. If
the
merged document has the form proctection turned off, it works, but then
all
the new documents are unprocted as well. Is there a way to keep the form
protection in my new documents?



  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Smhall Smhall is offline
external usenet poster
 
Posts: 9
Default Protect form fields in merged files

Thanks for sending me in the right direction. I got it to work by putting 2
new commands in the "SplitMergeLetter" macro I copied from Graham Mayor's web
site. The first command unprotects the new document and the second command
re-protects it. I'm copying it here in case anyone in the future (who feels
WAY in over their heads) needs it:

Sub Splitter()
ActiveDocument.Unprotect
Selection.EndKey Unit:=wdStory
Letters = Selection.Information(wdActiveEndSectionNumber)
Selection.HomeKey Unit:=wdStory
Counter = 1
While Counter Letters
Application.ScreenUpdating = False
With Selection
..HomeKey Unit:=wdStory
..EndKey Unit:=wdLine, Extend:=wdExtend
..MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
End With
sName = Selection
Docname = "c:\in process\merge\" & sName & ".doc"
ActiveDocument.Sections.First.Range.Cut
Documents.Add
With Selection
..Paste
..HomeKey Unit:=wdStory
..MoveDown Unit:=wdLine, Count:=1, Extend:=wdExtend
..Delete
End With
ActiveDocument.Protect wdAllowOnlyFormFields, NoReset
ActiveDocument.SaveAs FileName:=Docname, _
FileFormat:=wdFormatDocument
ActiveWindow.Close
Counter = Counter + 1
Application.ScreenUpdating = True
Wend

End Sub

FYI: You need to change the Doc Name to a valid path and make sure the file
name is the VERY FIRST thing in the document

"Doug Robbins - Word MVP" wrote:

After you create each individual document, use the command to protect it.

ActiveDocument.Protect wdAllowOnlyFormFields, NoReset

--
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

"Smhall" wrote in message
...
Using the information from the amazing MVPs, I have created a document
that
merges excel data into a document with form fields(that spell checks!!!).
I'm stuck on one last piece of the puzzle. I am trying to split the
merged
document into individual files using a merge field as the user name. If
the
merged document has the form proctection turned off, it works, but then
all
the new documents are unprocted as well. Is there a way to keep the form
protection in my new documents?




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
Blank return for drop-down form fields Peter B. Microsoft Word Help 4 January 26th 07 05:01 PM
Form text fields are disappearing during a merge to new document. Trevor Drew Mailmerge 7 January 30th 06 09:35 PM
Default text shown in form fields Gitte Microsoft Word Help 1 January 2nd 06 03:16 PM
How do I use a form then mailmerge without losing the form fields Someone who's stuck Mailmerge 1 June 23rd 05 10:01 AM
Email a protected document that contains Text Form Fields Dowza New Users 1 January 8th 05 10:31 AM


All times are GMT +1. The time now is 03:43 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"