My problem is that when I follow all of the instructions and then try to
create a new document from my template I get the error, "The requested
member of the collection does not exist." It fails on this code:
What I find is that the Bookmarks collection is empty but there are two
items in the Fields collection.
What am I missing?
FWIW, I used to be a programmer (VB 4, 5, and 6 and C#), but I never did
much VBA stuff and don't know the Office object model too well. (Plus its
been a while.)
(Msg. 2) Posted: Tue Mar 04, 2008 9:24 pm
Post subject: Re: Bookmarks and UserForm [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
Please clarify: "What I find is that the Bookmarks collection is empty but
there are two
items in the Fields collection."
Where are you seeing (looking at) the Fields collection?
You did in fact make bookmarks?
Matt wrote:
>Howdy.
>
>I am trying to do something quite simple and should be able to figure this
>out. My time is tight these days, though, so I'll just hope for some help.
>
>I am just trying to get a UserForm to populate a template in Word 2003. I'm
>following these instructions (which are supposed to be valid for W2003):
>
>http://word.mvps.org/FAQs/Userforms/CreateAUserForm.htm
>
>My problem is that when I follow all of the instructions and then try to
>create a new document from my template I get the error, "The requested
>member of the collection does not exist." It fails on this code:
>
>.Bookmarks("Text1").Range _
> .InsertBefore TextBox1
>
>What I find is that the Bookmarks collection is empty but there are two
>items in the Fields collection.
>
>What am I missing?
>
>FWIW, I used to be a programmer (VB 4, 5, and 6 and C#), but I never did
>much VBA stuff and don't know the Office object model too well. (Plus its
>been a while.)
>
>Thank you for any help anyone can give.
>
>Matt
(Msg. 3) Posted: Wed Mar 05, 2008 6:42 am
Post subject: Re: Bookmarks and UserForm [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
Using the Immediate window, I checked the count in the bookmarks collection
(I'm assuming it is a collection) and the value was 0. I did the same for
the Fields collection and the count was 2.
The word "bookmark" confuses me a bit. What I did was follow the directions
in the page for which I provided a link and they instructed the insertion of
"Ref" fields. That seems to be the same as a bookmark, but you are correct
to question whether my understanding of the terminology is correct--it may
not be.
Here is what my document looks like (with the field codes visible):
{ REF Text1 }
{ REF Text2 }
Interestingly (I had not noticed this before), when I open the document
*without* the field codes showing the fields display "Error! Reference
source not found."
Matt
"fumei via OfficeKB.com" <u37563@uwe> wrote in message
news:80ab85dad3d1e@uwe...
> Please clarify: "What I find is that the Bookmarks collection is empty but
> there are two
> items in the Fields collection."
>
> Where are you seeing (looking at) the Fields collection?
> You did in fact make bookmarks?
>
> Matt wrote:
>>Howdy.
>>
>>I am trying to do something quite simple and should be able to figure this
>>out. My time is tight these days, though, so I'll just hope for some
>>help.
>>
>>I am just trying to get a UserForm to populate a template in Word 2003.
>>I'm
>>following these instructions (which are supposed to be valid for W2003):
>>
>>http://word.mvps.org/FAQs/Userforms/CreateAUserForm.htm
>>
>>My problem is that when I follow all of the instructions and then try to
>>create a new document from my template I get the error, "The requested
>>member of the collection does not exist." It fails on this code:
>>
>>.Bookmarks("Text1").Range _
>> .InsertBefore TextBox1
>>
>>What I find is that the Bookmarks collection is empty but there are two
>>items in the Fields collection.
>>
>>What am I missing?
>>
>>FWIW, I used to be a programmer (VB 4, 5, and 6 and C#), but I never did
>>much VBA stuff and don't know the Office object model too well. (Plus its
>>been a while.)
>>
>>Thank you for any help anyone can give.
>>
>>Matt
>
> --
> Message posted via OfficeKB.com
> http://www.officekb.com/Uwe/Forums.aspx/word-programming/200803/1 >
(Msg. 4) Posted: Thu Mar 06, 2008 3:14 am
Post subject: Re: Bookmarks and UserForm [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
There is no where in that article where it talks about inserting cross
reference { REF } fields other than in the final paragraph of step 2
Create two bookmarks in your template named "Text1" and "Text2". To create
each bookmark, select a single space so that when you turn on the option to
see the bookmarks under Tools>Options>View, the bookmarks appear as []
rather than |. When you create bookmarks with a space selected like this,
the text will be inserted inside the bookmark, rather than after it.
You can then use a cross reference to the text of the bookmark if you want
the same information to appear in another location.
But, you MUST FIRST INSERT THE BOOKMARKS otherwise there is nowhere for the
code in the form to insert the information, nor is there anywhere in the
document for the cross reference field to obtain the information that it
would display
Did you insert bookmarks with the names of Text1 and Text2 into the
template. I'll bet anything that you want that you did not because it is
the absence of those bookmarks that caused the error that you are receiving
when you use the form and also the error that you see when you toggle off
the display of the formfields.
--
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
"Matt" <mgould.RemoveThis@bell-law.com> wrote in message
news:eW4JxYsfIHA.4436@TK2MSFTNGP02.phx.gbl...
> Using the Immediate window, I checked the count in the bookmarks
> collection (I'm assuming it is a collection) and the value was 0. I did
> the same for the Fields collection and the count was 2.
>
> The word "bookmark" confuses me a bit. What I did was follow the
> directions in the page for which I provided a link and they instructed the
> insertion of "Ref" fields. That seems to be the same as a bookmark, but
> you are correct to question whether my understanding of the terminology is
> correct--it may not be.
>
> Here is what my document looks like (with the field codes visible):
>
> { REF Text1 }
> { REF Text2 }
>
> Interestingly (I had not noticed this before), when I open the document
> *without* the field codes showing the fields display "Error! Reference
> source not found."
>
> Matt
>
> "fumei via OfficeKB.com" <u37563@uwe> wrote in message
> news:80ab85dad3d1e@uwe...
>> Please clarify: "What I find is that the Bookmarks collection is empty
>> but
>> there are two
>> items in the Fields collection."
>>
>> Where are you seeing (looking at) the Fields collection?
>> You did in fact make bookmarks?
>>
>> Matt wrote:
>>>Howdy.
>>>
>>>I am trying to do something quite simple and should be able to figure
>>>this
>>>out. My time is tight these days, though, so I'll just hope for some
>>>help.
>>>
>>>I am just trying to get a UserForm to populate a template in Word 2003.
>>>I'm
>>>following these instructions (which are supposed to be valid for W2003):
>>>
>>>http://word.mvps.org/FAQs/Userforms/CreateAUserForm.htm
>>>
>>>My problem is that when I follow all of the instructions and then try to
>>>create a new document from my template I get the error, "The requested
>>>member of the collection does not exist." It fails on this code:
>>>
>>>.Bookmarks("Text1").Range _
>>> .InsertBefore TextBox1
>>>
>>>What I find is that the Bookmarks collection is empty but there are two
>>>items in the Fields collection.
>>>
>>>What am I missing?
>>>
>>>FWIW, I used to be a programmer (VB 4, 5, and 6 and C#), but I never did
>>>much VBA stuff and don't know the Office object model too well. (Plus
>>>its
>>>been a while.)
>>>
>>>Thank you for any help anyone can give.
>>>
>>>Matt
>>
>> --
>> Message posted via OfficeKB.com
>> http://www.officekb.com/Uwe/Forums.aspx/word-programming/200803/1 >>
>
>
(Msg. 5) Posted: Thu Mar 06, 2008 3:14 am
Post subject: Re: Bookmarks and UserForm [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
Doug,
Well, there you have it. For some reason, I thought that a REF field was
the same thing as a bookmark. Now I see the Bookmark on the Insert menu.
I'll play with this some more.
Thank you for your help, Doug.
Matt
"Doug Robbins - Word MVP" <dkr.TakeThisOut@REMOVECAPSmvps.org> wrote in message
news:uK3A%23uvfIHA.4396@TK2MSFTNGP04.phx.gbl...
> There is no where in that article where it talks about inserting cross
> reference { REF } fields other than in the final paragraph of step 2
>
> Create two bookmarks in your template named "Text1" and "Text2". To create
> each bookmark, select a single space so that when you turn on the option
> to see the bookmarks under Tools>Options>View, the bookmarks appear as []
> rather than |. When you create bookmarks with a space selected like this,
> the text will be inserted inside the bookmark, rather than after it.
>
> You can then use a cross reference to the text of the bookmark if you want
> the same information to appear in another location.
>
> But, you MUST FIRST INSERT THE BOOKMARKS otherwise there is nowhere for
> the code in the form to insert the information, nor is there anywhere in
> the document for the cross reference field to obtain the information that
> it would display
>
> Did you insert bookmarks with the names of Text1 and Text2 into the
> template. I'll bet anything that you want that you did not because it is
> the absence of those bookmarks that caused the error that you are
> receiving when you use the form and also the error that you see when you
> toggle off the display of the formfields.
>
>
>
> --
> 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
>
> "Matt" <mgould.TakeThisOut@bell-law.com> wrote in message
> news:eW4JxYsfIHA.4436@TK2MSFTNGP02.phx.gbl...
>> Using the Immediate window, I checked the count in the bookmarks
>> collection (I'm assuming it is a collection) and the value was 0. I did
>> the same for the Fields collection and the count was 2.
>>
>> The word "bookmark" confuses me a bit. What I did was follow the
>> directions in the page for which I provided a link and they instructed
>> the insertion of "Ref" fields. That seems to be the same as a bookmark,
>> but you are correct to question whether my understanding of the
>> terminology is correct--it may not be.
>>
>> Here is what my document looks like (with the field codes visible):
>>
>> { REF Text1 }
>> { REF Text2 }
>>
>> Interestingly (I had not noticed this before), when I open the document
>> *without* the field codes showing the fields display "Error! Reference
>> source not found."
>>
>> Matt
>>
>> "fumei via OfficeKB.com" <u37563@uwe> wrote in message
>> news:80ab85dad3d1e@uwe...
>>> Please clarify: "What I find is that the Bookmarks collection is empty
>>> but
>>> there are two
>>> items in the Fields collection."
>>>
>>> Where are you seeing (looking at) the Fields collection?
>>> You did in fact make bookmarks?
>>>
>>> Matt wrote:
>>>>Howdy.
>>>>
>>>>I am trying to do something quite simple and should be able to figure
>>>>this
>>>>out. My time is tight these days, though, so I'll just hope for some
>>>>help.
>>>>
>>>>I am just trying to get a UserForm to populate a template in Word 2003.
>>>>I'm
>>>>following these instructions (which are supposed to be valid for W2003):
>>>>
>>>>http://word.mvps.org/FAQs/Userforms/CreateAUserForm.htm
>>>>
>>>>My problem is that when I follow all of the instructions and then try to
>>>>create a new document from my template I get the error, "The requested
>>>>member of the collection does not exist." It fails on this code:
>>>>
>>>>.Bookmarks("Text1").Range _
>>>> .InsertBefore TextBox1
>>>>
>>>>What I find is that the Bookmarks collection is empty but there are two
>>>>items in the Fields collection.
>>>>
>>>>What am I missing?
>>>>
>>>>FWIW, I used to be a programmer (VB 4, 5, and 6 and C#), but I never did
>>>>much VBA stuff and don't know the Office object model too well. (Plus
>>>>its
>>>>been a while.)
>>>>
>>>>Thank you for any help anyone can give.
>>>>
>>>>Matt
>>>
>>> --
>>> Message posted via OfficeKB.com
>>> http://www.officekb.com/Uwe/Forums.aspx/word-programming/200803/1 >>>
>>
>>
>
>
(Msg. 6) Posted: Sun Mar 23, 2008 9:36 pm
Post subject: Re: Bookmarks and UserForm [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
On Mar 6, 7:01 am, "Doug Robbins - Word MVP" <d....RemoveThis@REMOVECAPSmvps.org>
wrote:
> There is no where in that article where it talks about inserting cross
> reference { REF } fields other than in the final paragraph of step 2
>
> Create two bookmarks in your template named "Text1" and "Text2". To create
> each bookmark, select a single space so that when you turn on the option to
> see the bookmarks under Tools>Options>View, the bookmarks appear as []
> rather than |. When you create bookmarks with a space selected like this,
> the text will be inserted inside the bookmark, rather than after it.
>
> You can then use a cross reference to the text of the bookmark if you want
> the same information to appear in another location.
>
> But, you MUST FIRST INSERT THE BOOKMARKS otherwise there is nowhere for the
> code in the form to insert the information, nor is there anywhere in the
> document for the cross reference field to obtain the information that it
> would display
>
> Did you insert bookmarks with the names of Text1 and Text2 into the
> template. I'll bet anything that you want that you did not because it is
> the absence of those bookmarks that caused the error that you are receiving
> when you use the form and also the error that you see when you toggle off
> the display of the formfields.
>
> --
> 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
>
> "Matt" <mgo....RemoveThis@bell-law.com> wrote in message
>
> news:eW4JxYsfIHA.4436@TK2MSFTNGP02.phx.gbl...
>
> > Using the Immediate window, I checked the count in the bookmarks
> > collection (I'm assuming it is a collection) and the value was 0. I did
> > the same for the Fields collection and the count was 2.
>
> > The word "bookmark" confuses me a bit. What I did was follow the
> > directions in the page for which I provided a link and they instructed the
> > insertion of "Ref" fields. That seems to be the same as a bookmark, but
> > you are correct to question whether my understanding of the terminology is
> > correct--it may not be.
>
> > Here is what my document looks like (with the field codes visible):
>
> > { REF Text1 }
> > { REF Text2 }
>
> > Interestingly (I had not noticed this before), when I open the document
> > *without* the field codes showing the fields display "Error! Reference
> > source not found."
>
> > Matt
>
> > "fumei via OfficeKB.com" <u37563@uwe> wrote in message
> >news:80ab85dad3d1e@uwe...
> >> Please clarify: "What I find is that the Bookmarks collection is empty
> >> but
> >> there are two
> >> items in the Fields collection."
>
> >> Where are you seeing (looking at) the Fields collection?
> >> You did in fact make bookmarks?
>
> >> Matt wrote:
> >>>Howdy.
>
> >>>I am trying to do something quite simple and should be able to figure
> >>>this
> >>>out. My time is tight these days, though, so I'll just hope for some
> >>>help.
>
> >>>I am just trying to get a UserForm to populate a template in Word 2003.
> >>>I'm
> >>>following these instructions (which are supposed to be valid for W2003):
>
> >>>http://word.mvps.org/FAQs/Userforms/CreateAUserForm.htm
>
> >>>My problem is that when I follow all of the instructions and then try to
> >>>create a new document from my template I get the error, "The requested
> >>>member of the collection does not exist." It fails on this code:
>
> >>>.Bookmarks("Text1").Range _
> >>> .InsertBefore TextBox1
>
> >>>What I find is that the Bookmarks collection is empty but there are two
> >>>items in the Fields collection.
>
> >>>What am I missing?
>
> >>>FWIW, I used to be a programmer (VB 4, 5, and 6 and C#), but I never did
> >>>much VBA stuff and don't know the Office object model too well. (Plus
> >>>its
> >>>been a while.)
>
> >>>Thank you for any help anyone can give.
>
> >>>Matt
>
> >> --
> >> Message posted via OfficeKB.com
> >>http://www.officekb.com/Uwe/Forums.aspx/word-programming/200803/1
When you insert a Word Forms Textbox fields, although they do not need
to have a bookmark name they will get a bookmark name assigned to it
automatically. The first one inserted will be called "Text1" then
next "text2 etc.
It seems to me that you have some cross references to theses bookmarks/
fields but when copying the fields they lost their bookmark names.
The solution is to double click on the field and assign the
appropriate name Fields settings part of the "text Form Field Options"
dialog box.
(Msg. 7) Posted: Thu May 22, 2008 3:19 pm
Post subject: Re: Bookmarks and UserForm [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
All times are: Eastern Time (US & Canada) (change)
Page 1 of 1
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum