Thank you, Doug.
I added that piece of code to my macro and it worked like a charm. With just
a slight problem: after the macro is executed, the fields are unprotected and
I can't use the "Clean fields" option in the form toolbar. Is there any way
of reversing the process at the end of the macro?
Something like "Unprotect/Unlink/Send by mail/Link and protect document
again". The purpose is to restore the initial state of the fields/document,
keeping all the protections and fields' definitions.
I had the document protected with a password. I had to remove it, the code
you sent me gave an error "Invalid password". How can I keep the password
protection and only let this macro unprotect the document? Any parameter I
can use? ActiveDocument.Unprotect.Password."my password" or something like
that?...
Here is the current macro I'm using:
Sub sendmail()
With ActiveDocument
.Unprotect
.Fields.Unlink
End With
With Application.ActiveDocument.MailEnvelope
.Introduction = " "
With .Item
.Subject = "Doc title"
.To = "mymail@mymailserver"
.Send
End With
End With
End Sub
____________________________________________
Hi Psantos,
Apparently Doug missed, this. He may be on vacation or something... I'm not
sure I can help, but I can keep the thread "alive" :-)
> I added that piece of code to my macro and it worked like a charm. With just
> a slight problem: after the macro is executed, the fields are unprotected and
[quoted text clipped - 9 lines]
> that?...
>
Once "Unlink" has been performed, there are no more fields to protect. Their
content has all been turned into plain text; that's what "Unlink" does.
It might be best to first save the document to file, before generating the
emails. Then you'll have it in its original state, with protection and all.
> Here is the current macro I'm using:
>
[quoted text clipped - 20 lines]
> > .Fields.Unlink
> >End With
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org
This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :-)