Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Darren Ingram Darren Ingram is offline
external usenet poster
 
Posts: 10
Default Cross Referencing bookmarks created by a Userform

Hi all,

I've created a letter which pops up a Userform which the user completes and
the information is inserted into the letter. Rather than create multiple
bookmarks in the letter for the user's name (ie multiple entries of the same
data in the userform), I've thought about cross-referencing a single bookmark
and have that information inserted at multiple points in the document.

This is where the problem starts. I insert a cross reference into the
document (stating that it is Reference Type: Bookmark and Insert reference
to: Bookmark text) ...nothing comes up to show that a cross-reference is
inserted (as a bookmark would show - is this normal?) also, when I run the
document using the Userform I get blank fields as a result.

Any assistance would be appreciated!!


  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Suzanne S. Barnhill Suzanne S. Barnhill is offline
external usenet poster
 
Posts: 33,624
Default Cross Referencing bookmarks created by a Userform

It could be that the insertion is overwriting the bookmark. See
http://word.mvps.org/FAQs/MacrosVBA/...AtBookmark.htm

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

"Darren Ingram" wrote in message
...
Hi all,

I've created a letter which pops up a Userform which the user completes
and
the information is inserted into the letter. Rather than create multiple
bookmarks in the letter for the user's name (ie multiple entries of the
same
data in the userform), I've thought about cross-referencing a single
bookmark
and have that information inserted at multiple points in the document.

This is where the problem starts. I insert a cross reference into the
document (stating that it is Reference Type: Bookmark and Insert reference
to: Bookmark text) ...nothing comes up to show that a cross-reference is
inserted (as a bookmark would show - is this normal?) also, when I run
the
document using the Userform I get blank fields as a result.

Any assistance would be appreciated!!





  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Darren Ingram Darren Ingram is offline
external usenet poster
 
Posts: 10
Default Cross Referencing bookmarks created by a Userform

Thanks Suzanne,

I'm a little bit of a novice when it comes to Userforms....Would you add
your code within the Private Sub CommandBUtton1_Click() code but before the
userform bookmarks being activated (as below) or would you run it at the end?
Would my coding look like this from the CommandButton?

I feel there is much to learn about the Userform/bookmark process....(I'm
sure you are rolling your eyes as you say "Uh huh!!"

Thanks for your help.
_____________________________________

Private Sub CommandButton1_Click()

Sub UpdateBookmark(BookmarkToUpdate As String, TextToUse As String)
Dim BMRange As Range
Set BMRange = ActiveDocument.Bookmarks(BookmarkToUpdate).Range
BMRange.Text = TextToUse
ActiveDocument.Bookmarks.Add BookmarkToUpdate, BMRange
End Sub

With ActiveDocument
..Bookmarks("Officer_firstname").Range _
..InsertBefore TextBox1
..Bookmarks("Officer_familyname").Range _
..InsertBefore TextBox2
..Bookmarks("Officer_telephone").Range _
..InsertBefore TextBox3
..Bookmarks("Officer_phoneextension").Range _
..InsertBefore TextBox4
..Bookmarks("Officer_emailname").Range _
..InsertBefore TextBox5
..Bookmarks("Client_title").Range _
..InsertBefore TextBox6
..Bookmarks("Client_firstname").Range _
..InsertBefore TextBox7
..Bookmarks("Client_familyname").Range _
..InsertBefore TextBox8
..Bookmarks("Todays_date").Range _
..InsertBefore TextBox9
End With

UserForm2.Hide

End Sub

"Suzanne S. Barnhill" wrote:

It could be that the insertion is overwriting the bookmark. See
http://word.mvps.org/FAQs/MacrosVBA/...AtBookmark.htm

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

"Darren Ingram" wrote in message
...
Hi all,

I've created a letter which pops up a Userform which the user completes
and
the information is inserted into the letter. Rather than create multiple
bookmarks in the letter for the user's name (ie multiple entries of the
same
data in the userform), I've thought about cross-referencing a single
bookmark
and have that information inserted at multiple points in the document.

This is where the problem starts. I insert a cross reference into the
document (stating that it is Reference Type: Bookmark and Insert reference
to: Bookmark text) ...nothing comes up to show that a cross-reference is
inserted (as a bookmark would show - is this normal?) also, when I run
the
document using the Userform I get blank fields as a result.

Any assistance would be appreciated!!






  #4   Report Post  
Posted to microsoft.public.word.docmanagement
Suzanne S. Barnhill Suzanne S. Barnhill is offline
external usenet poster
 
Posts: 33,624
Default Cross Referencing bookmarks created by a Userform

*I* would not do anything since I have no expertise in VBA (and consequently
am not rolling my eyes at all). You might want to post in the
microsoft.public.word.vba.userforms newsgroup for more expert help.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

"Darren Ingram" wrote in message
...
Thanks Suzanne,

I'm a little bit of a novice when it comes to Userforms....Would you add
your code within the Private Sub CommandBUtton1_Click() code but before
the
userform bookmarks being activated (as below) or would you run it at the
end?
Would my coding look like this from the CommandButton?

I feel there is much to learn about the Userform/bookmark process....(I'm
sure you are rolling your eyes as you say "Uh huh!!"

Thanks for your help.
_____________________________________

Private Sub CommandButton1_Click()

Sub UpdateBookmark(BookmarkToUpdate As String, TextToUse As String)
Dim BMRange As Range
Set BMRange = ActiveDocument.Bookmarks(BookmarkToUpdate).Range
BMRange.Text = TextToUse
ActiveDocument.Bookmarks.Add BookmarkToUpdate, BMRange
End Sub

With ActiveDocument
.Bookmarks("Officer_firstname").Range _
.InsertBefore TextBox1
.Bookmarks("Officer_familyname").Range _
.InsertBefore TextBox2
.Bookmarks("Officer_telephone").Range _
.InsertBefore TextBox3
.Bookmarks("Officer_phoneextension").Range _
.InsertBefore TextBox4
.Bookmarks("Officer_emailname").Range _
.InsertBefore TextBox5
.Bookmarks("Client_title").Range _
.InsertBefore TextBox6
.Bookmarks("Client_firstname").Range _
.InsertBefore TextBox7
.Bookmarks("Client_familyname").Range _
.InsertBefore TextBox8
.Bookmarks("Todays_date").Range _
.InsertBefore TextBox9
End With

UserForm2.Hide

End Sub

"Suzanne S. Barnhill" wrote:

It could be that the insertion is overwriting the bookmark. See
http://word.mvps.org/FAQs/MacrosVBA/...AtBookmark.htm

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

"Darren Ingram" wrote in message
...
Hi all,

I've created a letter which pops up a Userform which the user completes
and
the information is inserted into the letter. Rather than create
multiple
bookmarks in the letter for the user's name (ie multiple entries of the
same
data in the userform), I've thought about cross-referencing a single
bookmark
and have that information inserted at multiple points in the document.

This is where the problem starts. I insert a cross reference into the
document (stating that it is Reference Type: Bookmark and Insert
reference
to: Bookmark text) ...nothing comes up to show that a cross-reference
is
inserted (as a bookmark would show - is this normal?) also, when I run
the
document using the Userform I get blank fields as a result.

Any assistance would be appreciated!!








  #5   Report Post  
Posted to microsoft.public.word.docmanagement
Darren Ingram Darren Ingram is offline
external usenet poster
 
Posts: 10
Default Cross Referencing bookmarks created by a Userform

Suzanne,

Thanks for that.... I'm an 'expert' (I use that term very loosely) in many
things related to Office (to a point)....But when I start playing with VBA
macro writing with User forms I've certainly hit that point. Oh well, it's
all about learning isn't it? When I find my answer I'll attach it to this
thread so that you've the opportunity to add it to you arsenal of knowledge.
Thanks once again. - Darren

"Suzanne S. Barnhill" wrote:

*I* would not do anything since I have no expertise in VBA (and consequently
am not rolling my eyes at all). You might want to post in the
microsoft.public.word.vba.userforms newsgroup for more expert help.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

"Darren Ingram" wrote in message
...
Thanks Suzanne,

I'm a little bit of a novice when it comes to Userforms....Would you add
your code within the Private Sub CommandBUtton1_Click() code but before
the
userform bookmarks being activated (as below) or would you run it at the
end?
Would my coding look like this from the CommandButton?

I feel there is much to learn about the Userform/bookmark process....(I'm
sure you are rolling your eyes as you say "Uh huh!!"

Thanks for your help.
_____________________________________

Private Sub CommandButton1_Click()

Sub UpdateBookmark(BookmarkToUpdate As String, TextToUse As String)
Dim BMRange As Range
Set BMRange = ActiveDocument.Bookmarks(BookmarkToUpdate).Range
BMRange.Text = TextToUse
ActiveDocument.Bookmarks.Add BookmarkToUpdate, BMRange
End Sub

With ActiveDocument
.Bookmarks("Officer_firstname").Range _
.InsertBefore TextBox1
.Bookmarks("Officer_familyname").Range _
.InsertBefore TextBox2
.Bookmarks("Officer_telephone").Range _
.InsertBefore TextBox3
.Bookmarks("Officer_phoneextension").Range _
.InsertBefore TextBox4
.Bookmarks("Officer_emailname").Range _
.InsertBefore TextBox5
.Bookmarks("Client_title").Range _
.InsertBefore TextBox6
.Bookmarks("Client_firstname").Range _
.InsertBefore TextBox7
.Bookmarks("Client_familyname").Range _
.InsertBefore TextBox8
.Bookmarks("Todays_date").Range _
.InsertBefore TextBox9
End With

UserForm2.Hide

End Sub

"Suzanne S. Barnhill" wrote:

It could be that the insertion is overwriting the bookmark. See
http://word.mvps.org/FAQs/MacrosVBA/...AtBookmark.htm

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

"Darren Ingram" wrote in message
...
Hi all,

I've created a letter which pops up a Userform which the user completes
and
the information is inserted into the letter. Rather than create
multiple
bookmarks in the letter for the user's name (ie multiple entries of the
same
data in the userform), I've thought about cross-referencing a single
bookmark
and have that information inserted at multiple points in the document.

This is where the problem starts. I insert a cross reference into the
document (stating that it is Reference Type: Bookmark and Insert
reference
to: Bookmark text) ...nothing comes up to show that a cross-reference
is
inserted (as a bookmark would show - is this normal?) also, when I run
the
document using the Userform I get blank fields as a result.

Any assistance would be appreciated!!











  #6   Report Post  
dzigner dzigner is offline
Junior Member
 
Posts: 0
Default

Hi Darren

I am facing a similar situation, that when I enter info into my userform, it gets inserted into the bookmark, but not at any cross-reference places I have put in with that bookmark.
I would like a little help here, as I have to go further, and then auto insert an answer to a question on form, if the checkbox is checked.
thanks

Quote:
Originally Posted by Darren Ingram View Post
Suzanne,

Thanks for that.... I'm an 'expert' (I use that term very loosely) in many
things related to Office (to a point)....But when I start playing with VBA
macro writing with User forms I've certainly hit that point. Oh well, it's
all about learning isn't it? When I find my answer I'll attach it to this
thread so that you've the opportunity to add it to you arsenal of knowledge.
Thanks once again. - Darren


[/i][/color]
Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cross referencing bradsmih Microsoft Word Help 1 May 29th 07 04:48 PM
Cross Referencing Bookmarks Brian Microsoft Word Help 3 May 12th 06 04:17 PM
Cross Referencing Mailmerge Bookmarks Brian Mailmerge 3 May 12th 06 05:09 AM
Referencing bookmarks in Word 2003 - how do I NOT bring the font i Tom McCray Microsoft Word Help 1 March 3rd 05 04:46 PM
Bookmarks and cross-referencing..what am I doing wrong? ~D~ New Users 3 January 16th 05 08:18 PM


All times are GMT +1. The time now is 04:42 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"