User Form in word 2000

S

Shakeel Ahmad

Advanced thanks because when ever i asked a question, i got help from this
newsgroup...

In my office I use office 2000. When ever we receive a letter, we make a
noting sheet about that letter. and now all the concerned officers write
their comments on that notting sheet for further action about that letter.

in this noting file we have to write the letter reference No. , date,
receiving date, received from and subject of that letter..... then with this
noting i submit that letter to the concerned officers. A sample of noting is
:

" Placed below is letter No.(abcabcabc) dated xx/xx/xxxx received on
xx/xx/xxxx from (xyzxyzxyz) regarding (anysubject)--submitted for further
necessary action."

I want to make a user form for this noting file that when i open this file,
there should appear a user form with some fileds asking about the letter no.
, date, and etc... and when i click on OK button after filling the form, it
should make a new page in the above mentioned format

please help me if it is possible.
 
J

Jay Freedman

To get started, see
http://www.word.mvps.org/FAQs/Userforms/CreateAUserForm.htm. If you
get stuck, post a question about the specific thing that you're having
trouble with, and preferably include some or all of the code you have
so far.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
 
S

Shakeel Ahmad

Hello Sir, I have completed this basic lesson about userform... thanks! but
this is about to make a template. I want to use this userform in my existing
file and I want to use it that when i fill-in the user form it should create
a new page in the same file.

Thanks and Regards,
 
J

Jay Freedman

Hello Sir, I have completed this basic lesson about userform... thanks! but
this is about to make a template. I want to use this userform in my existing
file and I want to use it that when i fill-in the user form it should create
a new page in the same file.

Thanks and Regards,
You can save the userform in a document instead of a template. It
isn't recommended, because every time you open the document you'll get
a warning message about the macro code and be asked whether to disable
or enable it. (That's assuming your macro security level is set to
Medium; if it's set to High, the userform will be disabled without
asking.)

The better idea is to put the userform in a template _and_ use the
template as the base for the document. The code in the userform can
insert a page break followed by text (or better, start the new text
with a paragraph formatted in a style that includes the Next Page
paragraph attribute).

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
 
S

Shakeel Ahmad

Sir,

Thank You very much for your kind response. As i learnt the first userform
lesson with an example, can you guide me through an example that how can i
use the user form in a file and as at the first page i insert a book mark,
will i need to insert the bookmarks on every new page each time?

Another question Sir!

I receive some times a message that the macros for this document has been
disabled for help contact...etc....
 
S

Shakeel Ahmad

Sir,

Thank You very much for your kind response. As i learnt the first userform
lesson with an example, can you guide me through an example that how can i
use the user form in a file and as at the first page i insert a book mark,
will i need to insert the bookmarks on every new page each time?

Another question Sir!

I receive some times a message that the macros for this document has been
disabled for help contact...etc....
 
D

Doug Robbins - Word MVP

Reur second question, Jay Freedman's previous post told you why that would
happen and he suggested that you use a template instead of a document.

This is the sort of code that you would have in a command button click event
of a userform in a template to open a document and insert a new page at the
end of it into which information from the userform is to be inserted:

Dim recorddoc As Document
Dim myrange As Range

Set recorddoc = Documents.Open("Path\FileName") 'insert the path and
filename of your document
With recorddoc
Set myrange = .Range
myrange.Collapse wdCollapseEnd
myrange.InsertBreak wdPageBreak
.Range.InsertAfter "This is something to do with data entered on your
form " & txtControlName.Text & vbCr
'repeat for each piece of data
.Save
.Close
End With

You may also want to have another command button with click event containing
code to clear the data from the controls on the userform so that another
piece of correspondence can be dealt with and a third button to close the
userform when all correspondence for that session has been dealt with.

That said, I think that you should really consider the use of an Access
database for this purpose.

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

Shakeel Ahmad

Hello Sir, Hope this message will find you in the best of your health.

Mr. Jay Freedman's and your suggestion is surely the best way to adopt for
me that I should use the template instead of a document.

One point Sir you left in my message that some time I receive a message that
the macros are disabled for this document for help see the documentation
etc...

And Sir, Kindly tell me. When by using the template, I will make a new file,
is it possible that instead of saving this file with a new file name, I
could insert it into an existing file on the next new page?

Thanks and Regards.

Shakeel Ahmad.
 
D

Doug Robbins - Word MVP

Templates stored in either the User Templates Folder or the Work Group
Templates folder will not cause a macro security warning message to be
displayed as those Folders are considered as "Trusted Locations"

The code that I gave you opens the exisiting document to whcih a page is
added and into which page the information from the form is inserted before
that existing document is saved and closed.

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

Shakeel Ahmad

AssalamuAlaikum(may peace and blessing of God be upon you) Sir!
Hope it will find you in best of your health.

Sir I have used successfully the code you told me. And it really did what i
wanted.

Thank u very much Sir.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top