10 out of 10 to Mr. Doug Robbins - Creating a userform 
Author Message
 10 out of 10 to Mr. Doug Robbins - Creating a userform

A bookmark is a member of a collection, and all the members
of a collection are unique; otherwise you could never return
individual members.  As such it'll always be impossible for
VBA to allow repeated bookmarks.

Shane, what you probably need is for the code in the event
that dismisses the form to insert the material in all the
places it's needed.  So you could either place bookmarks
in each spot and do a series of .InsertAfter lines in the
code, or place REF fields in each spot (except the first)
and have your code use [expression].Fields.Update lines
after the first one is inserted. (The latter is preferable
if the first one might be changed later -- but then of
course the user *would* have to know about updating fields
to propagate the new info.)

Note that a field in a header won't update via a simple
ActiveDocument.Fields.Update.  You need to catch it in
the every "document story."  More help in the help.

--

Reply ONLY to the newsgroup.  Note: MVPs do not work for Microsoft.
MVP FAQ: http://www.*-*-*.com/
Userform demystification: http://www.*-*-*.com/ ~mtangard/userforms.html
"Life is nothing if you're not obsessed." --John Waters

--

Reply ONLY to the newsgroup.  Note: MVPs do not work for Microsoft.
MVP FAQ: http://www.*-*-*.com/
Userform demystification: http://www.*-*-*.com/ ~mtangard/userforms.html
"Life is nothing if you're not obsessed." --John Waters

Quote:

> What Version of Microsoft Word are they using?

> I am the Director of Technical Support for a company that
> has a Visual Basics 6.0 Proprietory Software Package that
> uses Microsoft Word Templates. Our documents can be
> customized, but currently, in Office 97 & 2000, you cannot
> repeat a Bookmark. As for Office XP, not sure. The ability
> may be there.

> Hope this helps you not waste time if your user has 97 or
> 2000.

> Julie
> >-----Original Message-----
> > http://www.*-*-*.com/
> m

> >Exactly what I was looking for as regards creating a
> userform. The only
> >shortcoming - and it applies to Word and not Mr. Robbin's
> instructions is
> >that the reason I want a userform is that the user only
> has to enter the
> >information once and it is inserted a number of places in
> the document.

> >Now I know that you can use the cross-reference to
> reference the bookmark -
> >the only problem is that the cross-references do not
> update automatically to
> >show the information that has just been entered into the
> userform since they
> >are fields. This means that a new user does not know that
> this can be
> >automatically updated and may start putting this info
> manually in the
> >document overwriting the fields.

> >Is there any other way of doing this. basically I want
> the user to enter the
> >information in the user form and the information to be
> automatically and
> >immediatly inserted in document in a number of instances,
> e.g. header, title
> >of document and in some tables.

> >Thanks in advance for any help folks.

> >Regards,
> >Shane

> >.



Mon, 21 Mar 2005 23:37:41 GMT  
 10 out of 10 to Mr. Doug Robbins - Creating a userform
Thanks everyone for their feedback - it has given me something to think
about. For this first version of the document I am going to use the
bookmarks and the active.document.fields.update to update the REF bookmarks
in every instance when the userform is dismissed.

I also received a handy piece of code from Doug - that displays a message if
the user tries to open the document insted of creating a new docuement based
on this template:

-----------------------
Sub AutoOpen()
If ActiveDocument.Type = wdTypeTemplate Then
    MsgBox "Instead of opening the template as you just did, select New from
the File menu and then select the template that you wish to use as the basis
for your document."
    ActiveDocument.Close wdDoNotSaveChanges
End If
End Sub
-----------------------

This would mean that users would not be able to edit the template and break
the userform. This should be OK for version1.

Again thanks for all the responses.

Shane


Quote:

> A bookmark is a member of a collection, and all the members
> of a collection are unique; otherwise you could never return
> individual members.  As such it'll always be impossible for
> VBA to allow repeated bookmarks.

> Shane, what you probably need is for the code in the event
> that dismisses the form to insert the material in all the
> places it's needed.  So you could either place bookmarks
> in each spot and do a series of .InsertAfter lines in the
> code, or place REF fields in each spot (except the first)
> and have your code use [expression].Fields.Update lines
> after the first one is inserted. (The latter is preferable
> if the first one might be changed later -- but then of
> course the user *would* have to know about updating fields
> to propagate the new info.)

> Note that a field in a header won't update via a simple
> ActiveDocument.Fields.Update.  You need to catch it in
> the every "document story."  More help in the help.

> --

> Reply ONLY to the newsgroup.  Note: MVPs do not work for Microsoft.
> MVP FAQ: http://www.mvps.org/word
> Userform demystification:

http://www.speakeasy.org/~mtangard/userforms.html
Quote:
> "Life is nothing if you're not obsessed." --John Waters

> --

> Reply ONLY to the newsgroup.  Note: MVPs do not work for Microsoft.
> MVP FAQ: http://www.mvps.org/word
> Userform demystification:

http://www.speakeasy.org/~mtangard/userforms.html

- Show quoted text -

Quote:
> "Life is nothing if you're not obsessed." --John Waters


> > What Version of Microsoft Word are they using?

> > I am the Director of Technical Support for a company that
> > has a Visual Basics 6.0 Proprietory Software Package that
> > uses Microsoft Word Templates. Our documents can be
> > customized, but currently, in Office 97 & 2000, you cannot
> > repeat a Bookmark. As for Office XP, not sure. The ability
> > may be there.

> > Hope this helps you not waste time if your user has 97 or
> > 2000.

> > Julie
> > >-----Original Message-----
> > >http://www.mvps.org/word/FAQs/Userforms/CreateAUserForm.ht
> > m

> > >Exactly what I was looking for as regards creating a
> > userform. The only
> > >shortcoming - and it applies to Word and not Mr. Robbin's
> > instructions is
> > >that the reason I want a userform is that the user only
> > has to enter the
> > >information once and it is inserted a number of places in
> > the document.

> > >Now I know that you can use the cross-reference to
> > reference the bookmark -
> > >the only problem is that the cross-references do not
> > update automatically to
> > >show the information that has just been entered into the
> > userform since they
> > >are fields. This means that a new user does not know that
> > this can be
> > >automatically updated and may start putting this info
> > manually in the
> > >document overwriting the fields.

> > >Is there any other way of doing this. basically I want
> > the user to enter the
> > >information in the user form and the information to be
> > automatically and
> > >immediatly inserted in document in a number of instances,
> > e.g. header, title
> > >of document and in some tables.

> > >Thanks in advance for any help folks.

> > >Regards,
> > >Shane

> > >.



Fri, 25 Mar 2005 16:26:13 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. 10 out of 10 to Mr. Doug Robbins - Creating a userform

2. Numbering the values in a Top 10 query from 1 to 10

3. 10 000 = 10 power 4 ?

4. exponentiel 10 000 = 10 ^4 ?

5. columns in a list b 10/10

6. Display records 10 by 10

7. JScript 10 != VBScript 10

8. Presenting Results 10 x 10

9. Inline parameter declaration eg , new Size (10,10))

10. Create one table from 10 tables in two files

11. Looking for some feedback VBCalender - File 1 of 1 - yEnc "VBcalender.exe" 3902478 bytes (10/10)

12. Question for Doug Robbins

 

 
Powered by phpBB® Forum Software