I create some forms in a document. So you have some text and afther the text
you have some forms. (or between the text)
I want to print only the forms and not the text. You can chose that option
by printing -> print only forms.
But the problem is that the form is in the middle of the text, the whole
paper is blanco, except the form. And I want to have the form not in the
middle in the text but on line 1, the first sentence.

I want to put all forms automatically together so that when you print, all
forms are together on a paper.
I tried it but I can't do.
I'm thinking about to export the forms to an other dcument, but I don't now
how to do that and if it will work.

Does anyone has an idea or suggestions that will work?

Re: printing forms only by Charles

Charles
Wed Dec 14 10:15:16 CST 2005

By forms do you mean online forms? Userforms are not things that print
easily.

The option for online forms is to print data only. Is this what you did? If
so, it will print only the information in formfields. The idea behind this
is to have an online form mimic a paper form so that you can fill the paper
form in using your computer. Doing this means that the information in the
formfields gets placed in the same location on the paper copy as it was on
the screen. Setting something up to actually do this is not easy.

What is all the text that precedes your "form?" What purpose does it serve?


It is possible to change your save options to save data only for forms. This
will give you a comma-delimited text file with your data.

For more about online forms, follow the links at
http://addbalance.com/word/wordwebresources.htm#Forms or
http://word.mvps.org/FAQs/Customization/FillinTheBlanks.htm especially Dian
Chapman's series of articles. You may also want to look at
http://www.word.mvps.org/FAQs/TblsFldsFms/LinesInForms.htm.

Hope this helps,
--

Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://word.mvps.org/FAQs/ which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
"Kagiso" <Kagiso@discussions.microsoft.com> wrote in message
news:C3F22838-7DC9-4922-9209-EEBED944DF94@microsoft.com...
>I create some forms in a document. So you have some text and afther the
>text
> you have some forms. (or between the text)
> I want to print only the forms and not the text. You can chose that option
> by printing -> print only forms.
> But the problem is that the form is in the middle of the text, the whole
> paper is blanco, except the form. And I want to have the form not in the
> middle in the text but on line 1, the first sentence.
>
> I want to put all forms automatically together so that when you print, all
> forms are together on a paper.
> I tried it but I can't do.
> I'm thinking about to export the forms to an other dcument, but I don't
> now
> how to do that and if it will work.
>
> Does anyone has an idea or suggestions that will work?



Re: printing forms only by Kagiso

Kagiso
Thu Dec 15 02:09:03 CST 2005

Hi,

Thanks for the answer.

But I don't mean online forms. On this link
http://s10.yousendit.com/d.aspx?id=1HX9UL2QGXKCC2FLEA8E052YZ3< /a> you find
a document.
The text is dutch but that doesn't matter because is only to give you a idea
what I mean.

I want to print only the forms. When I choose to print only the forms I have
the problem that the forms is in the middle of the page. I want to have the
forms on line 1.
Example: a document of 5 pages, every page has 1 form, I want to print only
the forms all together, so at least you have a paper with only all forms
without the texts above the forms.

Hope you understand what I try to say.



"Charles Kenyon" wrote:

> By forms do you mean online forms? Userforms are not things that print
> easily.
>
> The option for online forms is to print data only. Is this what you did? If
> so, it will print only the information in formfields. The idea behind this
> is to have an online form mimic a paper form so that you can fill the paper
> form in using your computer. Doing this means that the information in the
> formfields gets placed in the same location on the paper copy as it was on
> the screen. Setting something up to actually do this is not easy.
>
> What is all the text that precedes your "form?" What purpose does it serve?
>
>
> It is possible to change your save options to save data only for forms. This
> will give you a comma-delimited text file with your data.
>
> For more about online forms, follow the links at
> http://addbalance.com/word/wordwebresources.htm#Forms or
> http://word.mvps.org/FAQs/Customization/FillinTheBlanks.htm especially Dian
> Chapman's series of articles. You may also want to look at
> http://www.word.mvps.org/FAQs/TblsFldsFms/LinesInForms.htm.
>
> Hope this helps,
> --
>
> Charles Kenyon
>
> Word New User FAQ & Web Directory: http://addbalance.com/word
>
> Intermediate User's Guide to Microsoft Word (supplemented version of
> Microsoft's Legal Users' Guide) http://addbalance.com/usersguide
>
> See also the MVP FAQ: http://word.mvps.org/FAQs/ which is awesome!
> --------- --------- --------- --------- --------- ---------
> This message is posted to a newsgroup. Please post replies
> and questions to the newsgroup so that others can learn
> from my ignorance and your wisdom.
> "Kagiso" <Kagiso@discussions.microsoft.com> wrote in message
> news:C3F22838-7DC9-4922-9209-EEBED944DF94@microsoft.com...
> >I create some forms in a document. So you have some text and afther the
> >text
> > you have some forms. (or between the text)
> > I want to print only the forms and not the text. You can chose that option
> > by printing -> print only forms.
> > But the problem is that the form is in the middle of the text, the whole
> > paper is blanco, except the form. And I want to have the form not in the
> > middle in the text but on line 1, the first sentence.
> >
> > I want to put all forms automatically together so that when you print, all
> > forms are together on a paper.
> > I tried it but I can't do.
> > I'm thinking about to export the forms to an other dcument, but I don't
> > now
> > how to do that and if it will work.
> >
> > Does anyone has an idea or suggestions that will work?
>
>
>

Re: printing forms only by Kodeworks

Kodeworks
Thu Dec 15 16:43:21 CST 2005

Kagiso

You could encapsulate the text blocks you don't want to print within
bookmarks and hide those bookmarks when you are ready to print the
document.

For example, in your sample Test.doc, select all the text above the
form, go to Insert | Bookmark and give it a name, eg. "TextToHide1".
Then in your macro which you run before printing insert the command

ThisDocument.Bookmarks("TextToHide1").Range.Font.Hidden = True

To redisplay the text, replace "True" with "False"


Sunil Jadwani
Kodeworks - Business Automation Solutions
www.kodeworks.com


Re: printing forms only by Kagiso

Kagiso
Tue Dec 20 04:23:02 CST 2005

Sunil,

Thanks for your answer. But I didn't understand it for the fullest.
I select the text and bookmarked it.
But what do you mean by:
Then in your macro which you run before printing insert the command
ThisDocument.Bookmarks("TextToHide1").Range.Font.Hidden = True
To redisplay the text, replace "True" with "False" ?

What's the whole code for making the macro and where had I to put the text in?

How do I do this when I have more pages like this in 1 document?

A lot of questions again but I'm not really a microsoft-expert like you...

Kagiso




"Kodeworks" wrote:

> Kagiso
>
> You could encapsulate the text blocks you don't want to print within
> bookmarks and hide those bookmarks when you are ready to print the
> document.
>
> For example, in your sample Test.doc, select all the text above the
> form, go to Insert | Bookmark and give it a name, eg. "TextToHide1".
> Then in your macro which you run before printing insert the command
>
> ThisDocument.Bookmarks("TextToHide1").Range.Font.Hidden = True
>
> To redisplay the text, replace "True" with "False"
>
>
> Sunil Jadwani
> Kodeworks - Business Automation Solutions
> www.kodeworks.com
>
>

Re: printing forms only by Kagiso

Kagiso
Tue Dec 20 05:11:03 CST 2005

It works! I tried and tried and it least it works.
It works also with more pages with texts and forms. This is what I did in
the macro:
ThisDocument.Bookmarks("TextToHide1").Range.Font.Hidden = True
the text
ThisDocument.Bookmarks("TextToHide2").Range.Font.Hidden = False

Text to hide 2 is an other bookmark.

But now the next problem, I want to lock the text so you can't change the
texts and you can only fill in the forms. But when I do that you can't work
with macro's because the text is locked, they can only fill in the forms. I
want that users read the text, fill in the forms and than can choose if they
wanted to print the text only or not. But when the text is locked, you can't
work with macro's so you can't hide the text/bookmark and print only the
forms.

Kagiso


"Kagiso" wrote:

> Sunil,
>
> Thanks for your answer. But I didn't understand it for the fullest.
> I select the text and bookmarked it.
> But what do you mean by:
> Then in your macro which you run before printing insert the command
> ThisDocument.Bookmarks("TextToHide1").Range.Font.Hidden = True
> To redisplay the text, replace "True" with "False" ?
>
> What's the whole code for making the macro and where had I to put the text in?
>
> How do I do this when I have more pages like this in 1 document?
>
> A lot of questions again but I'm not really a microsoft-expert like you...
>
> Kagiso
>
>
>
>
> "Kodeworks" wrote:
>
> > Kagiso
> >
> > You could encapsulate the text blocks you don't want to print within
> > bookmarks and hide those bookmarks when you are ready to print the
> > document.
> >
> > For example, in your sample Test.doc, select all the text above the
> > form, go to Insert | Bookmark and give it a name, eg. "TextToHide1".
> > Then in your macro which you run before printing insert the command
> >
> > ThisDocument.Bookmarks("TextToHide1").Range.Font.Hidden = True
> >
> > To redisplay the text, replace "True" with "False"
> >
> >
> > Sunil Jadwani
> > Kodeworks - Business Automation Solutions
> > www.kodeworks.com
> >
> >

Re: printing forms only by Kodeworks

Kodeworks
Tue Dec 20 17:18:52 CST 2005

Kagiso

Glad you've found a way to make it work. I wasn't sure just how much
detail you required and I went with the bare minimum.

OK, so now you must surround the commands to show/hide the bookmarked
text with unprotect and protect commands, like so

'Before printing, unprotect the doc, hide the text, then re-protect
ThisDocument.Unprotect
ThisDocument.Bookmarks("TextToHide1").Range.Font.Hidden = True
ThisDocument.Bookmarks("TextToHide2").Range.Font.Hidden = True
ThisDocument.Protect Type:=wdAllowOnlyFormFields

'After printing, unprotect the doc, show the text, then re-protect
ThisDocument.Unprotect
ThisDocument.Bookmarks("TextToHide1").Range.Font.Hidden = False
ThisDocument.Bookmarks("TextToHide2").Range.Font.Hidden = False
ThisDocument.Protect Type:=wdAllowOnlyFormFields


Sunil Jadwani
Kodeworks - Business Automation Solutions
www.kodeworks.com


Re: printing forms only by Kagiso

Kagiso
Wed Dec 21 03:00:03 CST 2005

Sunil,

It works! I'm really happy you know, wow!
But there's still one problem left, when I fill in the forms and than
activate the first macro to hide the text, my information I filled in the
forms left.
I tried to handle this problem with a macro to protect the information in
the forms, but it doesn't works.

When this document is ready I want to send it to some users so they can fill
in some information. But it's a little bit much work for them on this way. Is
there a way to make it easier? I still works with keys on the keyboard.

Hope you have (again) an answer.

Kagiso

This is the code I used for protecting the text in the forms:

Sub ProtectIt()
ActiveDocument.Protect _
Type:=wdAllowOnlyFormFields, _
NoReset:=True, _

End Sub



"Kodeworks" wrote:

> Kagiso
>
> Glad you've found a way to make it work. I wasn't sure just how much
> detail you required and I went with the bare minimum.
>
> OK, so now you must surround the commands to show/hide the bookmarked
> text with unprotect and protect commands, like so
>
> 'Before printing, unprotect the doc, hide the text, then re-protect
> ThisDocument.Unprotect
> ThisDocument.Bookmarks("TextToHide1").Range.Font.Hidden = True
> ThisDocument.Bookmarks("TextToHide2").Range.Font.Hidden = True
> ThisDocument.Protect Type:=wdAllowOnlyFormFields
>
> 'After printing, unprotect the doc, show the text, then re-protect
> ThisDocument.Unprotect
> ThisDocument.Bookmarks("TextToHide1").Range.Font.Hidden = False
> ThisDocument.Bookmarks("TextToHide2").Range.Font.Hidden = False
> ThisDocument.Protect Type:=wdAllowOnlyFormFields
>
>
> Sunil Jadwani
> Kodeworks - Business Automation Solutions
> www.kodeworks.com
>
>

Re: printing forms only by Kodeworks

Kodeworks
Wed Dec 21 19:51:11 CST 2005

Kagiso

OK, let's see if I understand you correctly. There are two issues you
need addressed

1. The loss of the contents of the form fields when you re-protect the
form
2. An easy/automatic way for your users to run the macro that hides
the text before printing

For the first one, you're on the right track using the "NoReset"
parameter in the Protect method. You're probably getting an error on
this line of code because there's a ",_" after the "NoReset:=True".
Just in case you're not familiar, the "_" tells the compiler that the
command continues on the next line. I've written a simple routine,
ToggleHideText (see below), that will hide or display the text in the
bookmarks. You can add as many bookmarks as you need in this routine.

For your second issue, I assume you want the bookmark text to disappear
only when printing. So what you can do in intercept Word's printing
function with a sub called FilePrint, ask the user whether they want to
hide or display the text before printing, hide/display accordingly,
execute the printing and redisplay the text, like so.

Public Sub FilePrint()
'Ask the user whether to hide or display the text and do it
ToggleHideText (vbYes = MsgBox("Do you want to hide the boilerplate
text before printing?", vbYesNo, "Hide Text"))
'Force the hiding / displaying to complete before the print dialog
box shows up
DoEvents
Application.Dialogs(wdDialogFilePrint).Show 'This works only in
Word 2002/XP and later
ToggleHideText (False) 'Redisplay all the text
End Sub

Public Sub ToggleHideText(Hide As Boolean)
If ThisDocument.ProtectionType <> wdNoProtection Then
ThisDocument.Unprotect
End If
ThisDocument.Bookmarks("TextToHide1").Range.Font.Hidden = Hide
ThisDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True
End Sub



Sunil Jadwani
Kodeworks - Business Automation Solutions
www.kodeworks.com


Re: printing forms only by Kagiso

Kagiso
Thu Dec 22 09:37:02 CST 2005

Sunil,

Thanks fo the answer.
First I want to put this code in my document:
Public Sub ToggleHideText(Hide As Boolean)
If ThisDocument.ProtectionType <> wdNoProtection Then
ThisDocument.Unprotect
End If
ThisDocument.Bookmarks("Formulier1").Range.Font.Hidden = Hide
ThisDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True
End Sub

But I don't know why but it doenst work. When I fill in the first form
(bookmark 'formulier1) and I hide the text, the information I filled in the
fom has gone.

So that's the first think I want to works well before I start with the other
code.

In this link I put again my document with the macro's I put in yet:
http://s13.yousendit.com/d.aspx?id=3ILCFGF0J749F0FJZM1DJQB3R4
The "quickkeys" are:
Ctrl+Alt+X = Unprotect
Ctrl+Alt+Q = textTounhide12
Ctrl+Alt+W = textToHide12

Maybe you can take a look about it.
Next two weeks I think I won't look to this because tuesday I'm going on
holiday, snowboarding.
After holiday I will go on with this.
A merry christmas and a good new year.

Kagiso

Re: printing forms only by Kodeworks

Kodeworks
Fri Dec 23 03:27:04 CST 2005

Kagiso

Here's the problem - in all the 3 macros in your test document the
Unprotect command is run without first checking that the document is
protected. Unprotect will cause an error on a document that is not
protected. I realise I didn't make that clear in my first posting.

Anyway, the preferred way to unprotect a document is like so

If ThisDocument.ProtectionType <> wdNoProtection Then
ThisDocument.Unprotect
End If

I've run the 3 macros - Ctrl+Alt+X, Ctrl+Alt+Q, Ctrl+Alt+W - in your
test document with the Unprotect command fixed as above and they run
without errors and seem to do what you want them to do.

Snowboarding, huh? Sounds like fun. Well, spare a thought for those
of us on the discussion board while you're out there have a good time.
Merry Christmas and a Happy New Year!


Sunil Jadwani
Kodeworks - Business Automation Solutions
www.kodeworks.com