Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-27-2024, 11:45 PM
RRB's Avatar
RRB RRB is offline Cross reference formatting Windows 11 Cross reference formatting Office 2021
Susan Flamingo
Cross reference formatting
 
Join Date: May 2014
Location: The Holy City of Jerusalem
Posts: 263
RRB is on a distinguished road
Default Cross reference formatting

Hi Friends!

If I insert a CR to a bookmark and tell it to show the text of the BM, it shows the string with the formatting of the bookmarked text. Is there a way, maybe via VBA, that the CR should just be the format of the paragraph it is resting in? Also, is there a way to CR to a BM but change the display text of the CR altogether like to "Hi I am a CR" or whatever?

Thank you and have a good day!

Susan Flamingo

Update Edit:



Per Charle's Kenyon's website: Using Fields in Microsoft Word - a Tutorial in the Intermediate Users' Guide to Microsoft Word --

I should insert the CR as a REF field, and use the char format switch { REF myBookmark \* CharFormat }

the charformat switch applies the formatting that is applied to the word "REF".

But being that I am inserting the CR field via VBA, how do I format the letters "REF" via the code before I insert the field in actuality??

cross-posted
Redirecting

Last edited by RRB; 02-28-2024 at 06:27 AM. Reason: update to question
Reply With Quote
  #2  
Old 02-28-2024, 09:08 AM
Charles Kenyon Charles Kenyon is offline Cross reference formatting Windows 11 Cross reference formatting Office 2021
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,140
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

The cross-reference is a REF field.

To look at what fields are there, press Alt+F9 which toggles display of field codes.
You can see the field structure and code. (not completely for AutoTextList or HyperLink Fields, though)*

When you insert a cross-reference you insert a Ref field. If it is to anything other than an existing Bookmark (i.e. Heading, Caption) a hidden bookmark is inserted at the location you are cross-referencing.

You can get funky results if, after you insert a cross-reference, you go to the beginning of the referenced material and type. Say you want to insert something above what you cross-referenced. You go to the start and press Enter, move up and then start typing what you wanted to add. Say it is a heading. You reformat what you type to Normal or Body Text. Everything looks fine. When you update the cross reference (REF) field, it will now include what you added.

Hyperlinks also create these bookmarks but are not quite as problematic because they do not update to show the content linked. However, they still will go to the start of the hidden bookmark.

Answered by Stefan Blom in the answers forum.
Quote:
Q: If I insert a CR to a bookmark and tell it to show the text of the BM, it shows the string with the formatting of the bookmarked text. Is there a way, maybe via VBA, that the CR should just be the format of the paragraph it is resting in?
A: To have the cross-referenced text adjust to the formatting at the location of the cross-reference, add the \* CHARFORMAT switch to the cross-reference (REF) field.
Q: Also, is there a way to CR to a BM but change the display text of the CR altogether like to "Hi I am a CR" or whatever?
A: Insert a hyperlink to the bookmark.
References:
* See Pop-Up Text in Microsoft Word for more about the AutoTextList and Hyperlink Fields


Susan, I again ask you to please read A Message to Forum Cross-Posters. Take it to heart.
  • You posted this here and in the Word Answers Forum within minutes of each other this morning.
  • You did note the cross-post here, but not there.
  • You did not wait to see what response you got in one of the forums.
  • You did not follow basic etiquette.
  • You are a good person and eager to learn more about using Word.
  • You are exactly the kind of person we want to help.

You have been asking a lot of questions in the forums. This is a good thing. See also:

====================================
Off-topic rant/advice for Susan
====================================
I can say this here but am hesitant to be so blunt on the other answers forum. This is not a rant about you but about the other forum, where I am also a volunteer moderator.
  • The people there with the badge Independent Advisor work for an outside company paid by Microsoft to provide quick responses to questions. They often do not know what they are talking about, but are quick. Often their responses seem to come from Google searches and/or AI. They are paid more for speed than for accuracy.
  • The ones with the badge Microsoft Agent are somewhat better but often come up with a stock answer full of gobbledey-gook. They do not, I think, use Word.
  • Volunteer moderators, there, as here, try to keep the forum on track and usually know the program very well. They have been using the program for years.
  • There are often responses by other knowledgeable users.
  • The ones who have and MVP badge really know Word, can spot problems that confuse the others, and give good answers. They are also volunteers, but experts in the program.
  • You can learn more about the "badges" in the other forum here. That forum is the official Microsoft forum, while this one is completely independent.
Stefan is one of those MVPs.
- I will likely delete this violet text later.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cross reference formatting Cross-reference formatting issue reytla Word 3 01-13-2022 01:32 AM
Cross reference formatting Cross-reference does not maintain formatting from bookmark frannie Word 2 03-23-2017 04:33 PM
Cross reference formatting Locked Cross Reference Formatting Pete Jones Word 3 04-23-2016 09:14 PM
Cross reference formatting Reference number and cross reference for equation numbers to match the thesis format wmac Word 1 05-14-2013 08:54 PM
Cross reference formatting MS Word 2007: Cross-Reference Formatting Gone Haywire rphox2003 Word 7 03-13-2012 08:14 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:01 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft