Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
bsharp bsharp is offline
external usenet poster
 
Posts: 17
Default How to preserve format on cross-references when update

I am using Word 2007.

I have cross-references back to bookmarks through a 10 page document. All
the sources are on the first page.

When I put a cross-reference on the first page, formatting comes out fine,
even when data is updated.

On SOME of the other pages, the formatting changes. And it's even within the
field, for example, on a date field the month will be a smaller font size
than the day, and the day and year may be bold.

Doesn't seem to matter what I format the source as. When I format the
references, it will take, but then change when updated.
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
macropod[_2_] macropod[_2_] is offline
external usenet poster
 
Posts: 2,059
Default How to preserve format on cross-references when update

Hi bsharp,

Press Alt-F9 to expose the field codes. Your cross-references will look like {REF _123456789 \* MERGEFORMAT} or {REF _123456789 \*
MERGEFORMAT \h}. Delete the '\* MERGEFORMAT' string and press F9. When you're finished, press Alt-F9 again.

For future reference, uncheck the 'preserve formatting' option when inserting cross-references.

--
Cheers
macropod
[MVP - Microsoft Word]


"bsharp" wrote in message ...
I am using Word 2007.

I have cross-references back to bookmarks through a 10 page document. All
the sources are on the first page.

When I put a cross-reference on the first page, formatting comes out fine,
even when data is updated.

On SOME of the other pages, the formatting changes. And it's even within the
field, for example, on a date field the month will be a smaller font size
than the day, and the day and year may be bold.

Doesn't seem to matter what I format the source as. When I format the
references, it will take, but then change when updated.


  #3   Report Post  
Posted to microsoft.public.word.docmanagement
bsharp bsharp is offline
external usenet poster
 
Posts: 17
Default How to preserve format on cross-references when update

Thanks, first part of your tip worked great.

I don't see an option to uncheck the 'preserve formatting' option.

I was entering "ref Date" and then selecting both words, then hitting ctl-F9.

Then I tried inserting a cross reference, choosing bookmark, then choosing
the appropriate bookmark, but I don't see an option about preserving
formatting.

I did just find another way to do it, if I right-click on the
cross-reference, then choose edit field, there is a box checked to preserve
formatting that I can uncheck. So that is a little quicker way to handle the
first part of your tip.

"macropod" wrote:

Hi bsharp,

Press Alt-F9 to expose the field codes. Your cross-references will look like {REF _123456789 \* MERGEFORMAT} or {REF _123456789 \*
MERGEFORMAT \h}. Delete the '\* MERGEFORMAT' string and press F9. When you're finished, press Alt-F9 again.

For future reference, uncheck the 'preserve formatting' option when inserting cross-references.

--
Cheers
macropod
[MVP - Microsoft Word]


"bsharp" wrote in message ...
I am using Word 2007.

I have cross-references back to bookmarks through a 10 page document. All
the sources are on the first page.

When I put a cross-reference on the first page, formatting comes out fine,
even when data is updated.

On SOME of the other pages, the formatting changes. And it's even within the
field, for example, on a date field the month will be a smaller font size
than the day, and the day and year may be bold.

Doesn't seem to matter what I format the source as. When I format the
references, it will take, but then change when updated.



  #4   Report Post  
Posted to microsoft.public.word.docmanagement
macropod[_2_] macropod[_2_] is offline
external usenet poster
 
Posts: 2,059
Default How to preserve format on cross-references when update

Hi bsharp,

Sorry, the 'preserve formatting' option is only displayed via the right-click or when you use Insert|Field.

--
Cheers
macropod
[MVP - Microsoft Word]


"bsharp" wrote in message ...
Thanks, first part of your tip worked great.

I don't see an option to uncheck the 'preserve formatting' option.

I was entering "ref Date" and then selecting both words, then hitting ctl-F9.

Then I tried inserting a cross reference, choosing bookmark, then choosing
the appropriate bookmark, but I don't see an option about preserving
formatting.

I did just find another way to do it, if I right-click on the
cross-reference, then choose edit field, there is a box checked to preserve
formatting that I can uncheck. So that is a little quicker way to handle the
first part of your tip.

"macropod" wrote:

Hi bsharp,

Press Alt-F9 to expose the field codes. Your cross-references will look like {REF _123456789 \* MERGEFORMAT} or {REF _123456789
\*
MERGEFORMAT \h}. Delete the '\* MERGEFORMAT' string and press F9. When you're finished, press Alt-F9 again.

For future reference, uncheck the 'preserve formatting' option when inserting cross-references.

--
Cheers
macropod
[MVP - Microsoft Word]


"bsharp" wrote in message ...
I am using Word 2007.

I have cross-references back to bookmarks through a 10 page document. All
the sources are on the first page.

When I put a cross-reference on the first page, formatting comes out fine,
even when data is updated.

On SOME of the other pages, the formatting changes. And it's even within the
field, for example, on a date field the month will be a smaller font size
than the day, and the day and year may be bold.

Doesn't seem to matter what I format the source as. When I format the
references, it will take, but then change when updated.




  #5   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default How to preserve format on cross-references when update

The following macro

Sub InsertField()
SendKeys "{Tab}{Tab} +{Tab}+{Tab}"
Dialogs(wdDialogInsertField).Show
End Sub

will open the InsertField dialog with the 'preserve formatting' option
unchecked. It works in Word 2003 also.
Given that I can think of few circumstances where the mergeformat switch is
actually helpful, I use this on all my Word installations. Now why couldn't
we have had a charformat switch option instead?

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



macropod wrote:
Hi bsharp,

Sorry, the 'preserve formatting' option is only displayed via the
right-click or when you use Insert|Field.

"bsharp" wrote in message
...
Thanks, first part of your tip worked great.

I don't see an option to uncheck the 'preserve formatting' option.

I was entering "ref Date" and then selecting both words, then
hitting ctl-F9. Then I tried inserting a cross reference, choosing
bookmark, then
choosing the appropriate bookmark, but I don't see an option about
preserving formatting.

I did just find another way to do it, if I right-click on the
cross-reference, then choose edit field, there is a box checked to
preserve formatting that I can uncheck. So that is a little quicker
way to handle the first part of your tip.

"macropod" wrote:

Hi bsharp,

Press Alt-F9 to expose the field codes. Your cross-references will
look like {REF _123456789 \* MERGEFORMAT} or {REF _123456789 \*
MERGEFORMAT \h}. Delete the '\* MERGEFORMAT' string and press F9.
When you're finished, press Alt-F9 again. For future reference, uncheck
the 'preserve formatting' option when
inserting cross-references. --
Cheers
macropod
[MVP - Microsoft Word]


"bsharp" wrote in message
...
I am using Word 2007.

I have cross-references back to bookmarks through a 10 page
document. All the sources are on the first page.

When I put a cross-reference on the first page, formatting comes
out fine, even when data is updated.

On SOME of the other pages, the formatting changes. And it's even
within the field, for example, on a date field the month will be a
smaller font size than the day, and the day and year may be bold.

Doesn't seem to matter what I format the source as. When I format
the references, it will take, but then change when updated.





  #6   Report Post  
Posted to microsoft.public.word.docmanagement
macropod[_2_] macropod[_2_] is offline
external usenet poster
 
Posts: 2,059
Default How to preserve format on cross-references when update

Your task, should you choose to accept it, is to create a Charformat option ... that runs from the Field|Insert dialogue.

--
Cheers
macropod
[MVP - Microsoft Word]


"Graham Mayor" wrote in message ...
The following macro

Sub InsertField()
SendKeys "{Tab}{Tab} +{Tab}+{Tab}"
Dialogs(wdDialogInsertField).Show
End Sub

will open the InsertField dialog with the 'preserve formatting' option
unchecked. It works in Word 2003 also.
Given that I can think of few circumstances where the mergeformat switch is
actually helpful, I use this on all my Word installations. Now why couldn't
we have had a charformat switch option instead?

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



macropod wrote:
Hi bsharp,

Sorry, the 'preserve formatting' option is only displayed via the
right-click or when you use Insert|Field.

"bsharp" wrote in message
...
Thanks, first part of your tip worked great.

I don't see an option to uncheck the 'preserve formatting' option.

I was entering "ref Date" and then selecting both words, then
hitting ctl-F9. Then I tried inserting a cross reference, choosing
bookmark, then
choosing the appropriate bookmark, but I don't see an option about
preserving formatting.

I did just find another way to do it, if I right-click on the
cross-reference, then choose edit field, there is a box checked to
preserve formatting that I can uncheck. So that is a little quicker
way to handle the first part of your tip.

"macropod" wrote:

Hi bsharp,

Press Alt-F9 to expose the field codes. Your cross-references will
look like {REF _123456789 \* MERGEFORMAT} or {REF _123456789 \*
MERGEFORMAT \h}. Delete the '\* MERGEFORMAT' string and press F9.
When you're finished, press Alt-F9 again. For future reference, uncheck
the 'preserve formatting' option when
inserting cross-references. --
Cheers
macropod
[MVP - Microsoft Word]


"bsharp" wrote in message
...
I am using Word 2007.

I have cross-references back to bookmarks through a 10 page
document. All the sources are on the first page.

When I put a cross-reference on the first page, formatting comes
out fine, even when data is updated.

On SOME of the other pages, the formatting changes. And it's even
within the field, for example, on a date field the month will be a
smaller font size than the day, and the day and year may be bold.

Doesn't seem to matter what I format the source as. When I format
the references, it will take, but then change when updated.



  #7   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default How to preserve format on cross-references when update

How about

Sub InsertField()
Dim oRng As Range
Dim i As Variant
Dim sSwitch As String
Dim strChoice As String
SendKeys "{Tab}{Tab} +{Tab}+{Tab}"
Dialogs(wdDialogInsertField).Show
ActiveDocument.ActiveWindow.View.ShowFieldCodes = True
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Set oRng = Selection.Range
For i = 1 To oRng.Fields.Count
With oRng.Fields(i)
If InStr(1, .Code, "MERGEFORMAT") 0 Then
sSwitch = MsgBox("Use charformat in place of mergeformat
switch?", _
vbYesNo, _
"Insert Field")
If sSwitch = vbYes Then
.Code.Text = Replace(.Code.Text, _
"MERGEFORMAT", _
"CHARFORMAT")
End If
End If
.Update
End With
Next i
ActiveDocument.ActiveWindow.View.ShowFieldCodes = False
Selection.MoveRight Unit:=wdCharacter, Count:=1
End Sub


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


macropod wrote:
Your task, should you choose to accept it, is to create a Charformat
option ... that runs from the Field|Insert dialogue.

"Graham Mayor" wrote in message
...
The following macro

Sub InsertField()
SendKeys "{Tab}{Tab} +{Tab}+{Tab}"
Dialogs(wdDialogInsertField).Show
End Sub

will open the InsertField dialog with the 'preserve formatting'
option unchecked. It works in Word 2003 also.
Given that I can think of few circumstances where the mergeformat
switch is actually helpful, I use this on all my Word installations.
Now why couldn't we have had a charformat switch option instead?

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



macropod wrote:
Hi bsharp,

Sorry, the 'preserve formatting' option is only displayed via the
right-click or when you use Insert|Field.

"bsharp" wrote in message
...
Thanks, first part of your tip worked great.

I don't see an option to uncheck the 'preserve formatting' option.

I was entering "ref Date" and then selecting both words, then
hitting ctl-F9. Then I tried inserting a cross reference, choosing
bookmark, then
choosing the appropriate bookmark, but I don't see an option about
preserving formatting.

I did just find another way to do it, if I right-click on the
cross-reference, then choose edit field, there is a box checked to
preserve formatting that I can uncheck. So that is a little quicker
way to handle the first part of your tip.

"macropod" wrote:

Hi bsharp,

Press Alt-F9 to expose the field codes. Your cross-references will
look like {REF _123456789 \* MERGEFORMAT} or {REF _123456789 \*
MERGEFORMAT \h}. Delete the '\* MERGEFORMAT' string and press F9.
When you're finished, press Alt-F9 again. For future reference,
uncheck the 'preserve formatting' option when
inserting cross-references. --
Cheers
macropod
[MVP - Microsoft Word]


"bsharp" wrote in message
...
I am using Word 2007.

I have cross-references back to bookmarks through a 10 page
document. All the sources are on the first page.

When I put a cross-reference on the first page, formatting comes
out fine, even when data is updated.

On SOME of the other pages, the formatting changes. And it's even
within the field, for example, on a date field the month will be
a smaller font size than the day, and the day and year may be
bold. Doesn't seem to matter what I format the source as. When I
format
the references, it will take, but then change when updated.



  #8   Report Post  
Posted to microsoft.public.word.docmanagement
macropod[_2_] macropod[_2_] is offline
external usenet poster
 
Posts: 2,059
Default How to preserve format on cross-references when update

Hi Graham,

That's a good start, but for the Charformat switch to be useful, you also need to give the user all the normal font controls over
the first field description character, which is usually the 2nd character in the field.


--
Cheers
macropod
[MVP - Microsoft Word]


"Graham Mayor" wrote in message ...
How about

Sub InsertField()
Dim oRng As Range
Dim i As Variant
Dim sSwitch As String
Dim strChoice As String
SendKeys "{Tab}{Tab} +{Tab}+{Tab}"
Dialogs(wdDialogInsertField).Show
ActiveDocument.ActiveWindow.View.ShowFieldCodes = True
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Set oRng = Selection.Range
For i = 1 To oRng.Fields.Count
With oRng.Fields(i)
If InStr(1, .Code, "MERGEFORMAT") 0 Then
sSwitch = MsgBox("Use charformat in place of mergeformat switch?", _
vbYesNo, _
"Insert Field")
If sSwitch = vbYes Then
.Code.Text = Replace(.Code.Text, _
"MERGEFORMAT", _
"CHARFORMAT")
End If
End If
.Update
End With
Next i
ActiveDocument.ActiveWindow.View.ShowFieldCodes = False
Selection.MoveRight Unit:=wdCharacter, Count:=1
End Sub


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


macropod wrote:
Your task, should you choose to accept it, is to create a Charformat
option ... that runs from the Field|Insert dialogue.

"Graham Mayor" wrote in message
...
The following macro

Sub InsertField()
SendKeys "{Tab}{Tab} +{Tab}+{Tab}"
Dialogs(wdDialogInsertField).Show
End Sub

will open the InsertField dialog with the 'preserve formatting'
option unchecked. It works in Word 2003 also.
Given that I can think of few circumstances where the mergeformat
switch is actually helpful, I use this on all my Word installations.
Now why couldn't we have had a charformat switch option instead?

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



macropod wrote:
Hi bsharp,

Sorry, the 'preserve formatting' option is only displayed via the
right-click or when you use Insert|Field.

"bsharp" wrote in message
...
Thanks, first part of your tip worked great.

I don't see an option to uncheck the 'preserve formatting' option.

I was entering "ref Date" and then selecting both words, then
hitting ctl-F9. Then I tried inserting a cross reference, choosing
bookmark, then
choosing the appropriate bookmark, but I don't see an option about
preserving formatting.

I did just find another way to do it, if I right-click on the
cross-reference, then choose edit field, there is a box checked to
preserve formatting that I can uncheck. So that is a little quicker
way to handle the first part of your tip.

"macropod" wrote:

Hi bsharp,

Press Alt-F9 to expose the field codes. Your cross-references will
look like {REF _123456789 \* MERGEFORMAT} or {REF _123456789 \*
MERGEFORMAT \h}. Delete the '\* MERGEFORMAT' string and press F9.
When you're finished, press Alt-F9 again. For future reference,
uncheck the 'preserve formatting' option when
inserting cross-references. --
Cheers
macropod
[MVP - Microsoft Word]


"bsharp" wrote in message
...
I am using Word 2007.

I have cross-references back to bookmarks through a 10 page
document. All the sources are on the first page.

When I put a cross-reference on the first page, formatting comes
out fine, even when data is updated.

On SOME of the other pages, the formatting changes. And it's even
within the field, for example, on a date field the month will be
a smaller font size than the day, and the day and year may be
bold. Doesn't seem to matter what I format the source as. When I format
the references, it will take, but then change when updated.




  #9   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default How to preserve format on cross-references when update

If a user makes proper use of styles, ALL of the field will be formatted
with the required format and the field content will match the rest of the
line.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



macropod wrote:
Hi Graham,

That's a good start, but for the Charformat switch to be useful, you
also need to give the user all the normal font controls over the
first field description character, which is usually the 2nd character
in the field.

"Graham Mayor" wrote in message
...
How about

Sub InsertField()
Dim oRng As Range
Dim i As Variant
Dim sSwitch As String
Dim strChoice As String
SendKeys "{Tab}{Tab} +{Tab}+{Tab}"
Dialogs(wdDialogInsertField).Show
ActiveDocument.ActiveWindow.View.ShowFieldCodes = True
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Set oRng = Selection.Range
For i = 1 To oRng.Fields.Count
With oRng.Fields(i)
If InStr(1, .Code, "MERGEFORMAT") 0 Then
sSwitch = MsgBox("Use charformat in place of
mergeformat switch?", _ vbYesNo, _
"Insert Field")
If sSwitch = vbYes Then
.Code.Text = Replace(.Code.Text, _
"MERGEFORMAT", _
"CHARFORMAT")
End If
End If
.Update
End With
Next i
ActiveDocument.ActiveWindow.View.ShowFieldCodes = False
Selection.MoveRight Unit:=wdCharacter, Count:=1
End Sub


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


macropod wrote:
Your task, should you choose to accept it, is to create a Charformat
option ... that runs from the Field|Insert dialogue.

"Graham Mayor" wrote in message
...
The following macro

Sub InsertField()
SendKeys "{Tab}{Tab} +{Tab}+{Tab}"
Dialogs(wdDialogInsertField).Show
End Sub

will open the InsertField dialog with the 'preserve formatting'
option unchecked. It works in Word 2003 also.
Given that I can think of few circumstances where the mergeformat
switch is actually helpful, I use this on all my Word
installations. Now why couldn't we have had a charformat switch
option instead? --

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



macropod wrote:
Hi bsharp,

Sorry, the 'preserve formatting' option is only displayed via the
right-click or when you use Insert|Field.

"bsharp" wrote in message
...
Thanks, first part of your tip worked great.

I don't see an option to uncheck the 'preserve formatting'
option. I was entering "ref Date" and then selecting both words, then
hitting ctl-F9. Then I tried inserting a cross reference,
choosing bookmark, then
choosing the appropriate bookmark, but I don't see an option
about preserving formatting.

I did just find another way to do it, if I right-click on the
cross-reference, then choose edit field, there is a box checked
to preserve formatting that I can uncheck. So that is a little
quicker way to handle the first part of your tip.

"macropod" wrote:

Hi bsharp,

Press Alt-F9 to expose the field codes. Your cross-references
will look like {REF _123456789 \* MERGEFORMAT} or {REF
_123456789 \* MERGEFORMAT \h}. Delete the '\* MERGEFORMAT'
string and press F9. When you're finished, press Alt-F9 again.
For future reference, uncheck the 'preserve formatting' option
when inserting cross-references. --
Cheers
macropod
[MVP - Microsoft Word]


"bsharp" wrote in message
...
I am using Word 2007.

I have cross-references back to bookmarks through a 10 page
document. All the sources are on the first page.

When I put a cross-reference on the first page, formatting
comes out fine, even when data is updated.

On SOME of the other pages, the formatting changes. And it's
even within the field, for example, on a date field the month
will be a smaller font size than the day, and the day and year may
be
bold. Doesn't seem to matter what I format the source as. When
I format the references, it will take, but then change when
updated.



  #10   Report Post  
Posted to microsoft.public.word.docmanagement
macropod[_2_] macropod[_2_] is offline
external usenet poster
 
Posts: 2,059
Default How to preserve format on cross-references when update

Ah, but what if the user wants something different to emphasise the link (eg a character style, or hard formatting)?

--
Cheers
macropod
[MVP - Microsoft Word]


"Graham Mayor" wrote in message ...
If a user makes proper use of styles, ALL of the field will be formatted
with the required format and the field content will match the rest of the
line.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



macropod wrote:
Hi Graham,

That's a good start, but for the Charformat switch to be useful, you
also need to give the user all the normal font controls over the
first field description character, which is usually the 2nd character
in the field.

"Graham Mayor" wrote in message
...
How about

Sub InsertField()
Dim oRng As Range
Dim i As Variant
Dim sSwitch As String
Dim strChoice As String
SendKeys "{Tab}{Tab} +{Tab}+{Tab}"
Dialogs(wdDialogInsertField).Show
ActiveDocument.ActiveWindow.View.ShowFieldCodes = True
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Set oRng = Selection.Range
For i = 1 To oRng.Fields.Count
With oRng.Fields(i)
If InStr(1, .Code, "MERGEFORMAT") 0 Then
sSwitch = MsgBox("Use charformat in place of
mergeformat switch?", _ vbYesNo, _
"Insert Field")
If sSwitch = vbYes Then
.Code.Text = Replace(.Code.Text, _
"MERGEFORMAT", _
"CHARFORMAT")
End If
End If
.Update
End With
Next i
ActiveDocument.ActiveWindow.View.ShowFieldCodes = False
Selection.MoveRight Unit:=wdCharacter, Count:=1
End Sub


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


macropod wrote:
Your task, should you choose to accept it, is to create a Charformat
option ... that runs from the Field|Insert dialogue.

"Graham Mayor" wrote in message
...
The following macro

Sub InsertField()
SendKeys "{Tab}{Tab} +{Tab}+{Tab}"
Dialogs(wdDialogInsertField).Show
End Sub

will open the InsertField dialog with the 'preserve formatting'
option unchecked. It works in Word 2003 also.
Given that I can think of few circumstances where the mergeformat
switch is actually helpful, I use this on all my Word
installations. Now why couldn't we have had a charformat switch
option instead? --

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



macropod wrote:
Hi bsharp,

Sorry, the 'preserve formatting' option is only displayed via the
right-click or when you use Insert|Field.

"bsharp" wrote in message
...
Thanks, first part of your tip worked great.

I don't see an option to uncheck the 'preserve formatting'
option. I was entering "ref Date" and then selecting both words, then
hitting ctl-F9. Then I tried inserting a cross reference,
choosing bookmark, then
choosing the appropriate bookmark, but I don't see an option
about preserving formatting.

I did just find another way to do it, if I right-click on the
cross-reference, then choose edit field, there is a box checked
to preserve formatting that I can uncheck. So that is a little
quicker way to handle the first part of your tip.

"macropod" wrote:

Hi bsharp,

Press Alt-F9 to expose the field codes. Your cross-references
will look like {REF _123456789 \* MERGEFORMAT} or {REF
_123456789 \* MERGEFORMAT \h}. Delete the '\* MERGEFORMAT'
string and press F9. When you're finished, press Alt-F9 again.
For future reference, uncheck the 'preserve formatting' option
when inserting cross-references. --
Cheers
macropod
[MVP - Microsoft Word]


"bsharp" wrote in message
...
I am using Word 2007.

I have cross-references back to bookmarks through a 10 page
document. All the sources are on the first page.

When I put a cross-reference on the first page, formatting
comes out fine, even when data is updated.

On SOME of the other pages, the formatting changes. And it's
even within the field, for example, on a date field the month
will be a smaller font size than the day, and the day and year may
be
bold. Doesn't seem to matter what I format the source as. When
I format the references, it will take, but then change when
updated.





  #11   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default How to preserve format on cross-references when update

He can add it to the inserted field - just like any other formatting. The
charformat switch would ensure it stays thus when the field is updated.

While the code was merely an exercise to a see if it could be done, I quite
like the result so I am now using it. I feel another addition to my web site
coming on
--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



macropod wrote:
Ah, but what if the user wants something different to emphasise the
link (eg a character style, or hard formatting)?

"Graham Mayor" wrote in message
...
If a user makes proper use of styles, ALL of the field will be
formatted with the required format and the field content will match
the rest of the line.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



macropod wrote:
Hi Graham,

That's a good start, but for the Charformat switch to be useful, you
also need to give the user all the normal font controls over the
first field description character, which is usually the 2nd
character in the field.

"Graham Mayor" wrote in message
...
How about

Sub InsertField()
Dim oRng As Range
Dim i As Variant
Dim sSwitch As String
Dim strChoice As String
SendKeys "{Tab}{Tab} +{Tab}+{Tab}"
Dialogs(wdDialogInsertField).Show
ActiveDocument.ActiveWindow.View.ShowFieldCodes = True
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Set oRng = Selection.Range
For i = 1 To oRng.Fields.Count
With oRng.Fields(i)
If InStr(1, .Code, "MERGEFORMAT") 0 Then
sSwitch = MsgBox("Use charformat in place of
mergeformat switch?", _ vbYesNo, _
"Insert Field")
If sSwitch = vbYes Then
.Code.Text = Replace(.Code.Text, _
"MERGEFORMAT", _
"CHARFORMAT")
End If
End If
.Update
End With
Next i
ActiveDocument.ActiveWindow.View.ShowFieldCodes = False
Selection.MoveRight Unit:=wdCharacter, Count:=1
End Sub


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


macropod wrote:
Your task, should you choose to accept it, is to create a
Charformat option ... that runs from the Field|Insert dialogue.

"Graham Mayor" wrote in message
...
The following macro

Sub InsertField()
SendKeys "{Tab}{Tab} +{Tab}+{Tab}"
Dialogs(wdDialogInsertField).Show
End Sub

will open the InsertField dialog with the 'preserve formatting'
option unchecked. It works in Word 2003 also.
Given that I can think of few circumstances where the mergeformat
switch is actually helpful, I use this on all my Word
installations. Now why couldn't we have had a charformat switch
option instead? --

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



macropod wrote:
Hi bsharp,

Sorry, the 'preserve formatting' option is only displayed via
the right-click or when you use Insert|Field.

"bsharp" wrote in message
...
Thanks, first part of your tip worked great.

I don't see an option to uncheck the 'preserve formatting'
option. I was entering "ref Date" and then selecting both
words, then hitting ctl-F9. Then I tried inserting a cross
reference, choosing bookmark, then
choosing the appropriate bookmark, but I don't see an option
about preserving formatting.

I did just find another way to do it, if I right-click on the
cross-reference, then choose edit field, there is a box checked
to preserve formatting that I can uncheck. So that is a little
quicker way to handle the first part of your tip.

"macropod" wrote:

Hi bsharp,

Press Alt-F9 to expose the field codes. Your cross-references
will look like {REF _123456789 \* MERGEFORMAT} or {REF
_123456789 \* MERGEFORMAT \h}. Delete the '\* MERGEFORMAT'
string and press F9. When you're finished, press Alt-F9 again.
For future reference, uncheck the 'preserve formatting' option
when inserting cross-references. --
Cheers
macropod
[MVP - Microsoft Word]


"bsharp" wrote in message
...
I am using Word 2007.

I have cross-references back to bookmarks through a 10 page
document. All the sources are on the first page.

When I put a cross-reference on the first page, formatting
comes out fine, even when data is updated.

On SOME of the other pages, the formatting changes. And it's
even within the field, for example, on a date field the month
will be a smaller font size than the day, and the day and
year may be
bold. Doesn't seem to matter what I format the source as.
When I format the references, it will take, but then change when
updated.



  #12   Report Post  
Posted to microsoft.public.word.docmanagement
macropod[_2_] macropod[_2_] is offline
external usenet poster
 
Posts: 2,059
Default How to preserve format on cross-references when update

Hi Graham,

OK, but except for the fact that you've added the Charformat switch (which presumably will prevent the sometimes-reported occurrence
of Word inserting an unwanted Mergeformat switch), I don't see that you've actually accomplished much more than what you'd get by
simply deleting the Mergeformat switch, for which see Jay Freedman's post at:
http://www.officekb.com/Uwe/Forum.as...Field-defaults
which I've reporduced below.

Sub InsertFieldNoMergeFmt()
With Dialogs(wdDialogInsertField)
SendKeys "%v": .Show
End With
End Sub

--
Cheers
macropod
[MVP - Microsoft Word]


"Graham Mayor" wrote in message ...
He can add it to the inserted field - just like any other formatting. The charformat switch would ensure it stays thus when the
field is updated.

While the code was merely an exercise to a see if it could be done, I quite like the result so I am now using it. I feel another
addition to my web site coming on
--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



macropod wrote:
Ah, but what if the user wants something different to emphasise the
link (eg a character style, or hard formatting)?

"Graham Mayor" wrote in message
...
If a user makes proper use of styles, ALL of the field will be
formatted with the required format and the field content will match
the rest of the line.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



macropod wrote:
Hi Graham,

That's a good start, but for the Charformat switch to be useful, you
also need to give the user all the normal font controls over the
first field description character, which is usually the 2nd
character in the field.

"Graham Mayor" wrote in message
...
How about

Sub InsertField()
Dim oRng As Range
Dim i As Variant
Dim sSwitch As String
Dim strChoice As String
SendKeys "{Tab}{Tab} +{Tab}+{Tab}"
Dialogs(wdDialogInsertField).Show
ActiveDocument.ActiveWindow.View.ShowFieldCodes = True
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Set oRng = Selection.Range
For i = 1 To oRng.Fields.Count
With oRng.Fields(i)
If InStr(1, .Code, "MERGEFORMAT") 0 Then
sSwitch = MsgBox("Use charformat in place of
mergeformat switch?", _ vbYesNo, _
"Insert Field")
If sSwitch = vbYes Then
.Code.Text = Replace(.Code.Text, _
"MERGEFORMAT", _
"CHARFORMAT")
End If
End If
.Update
End With
Next i
ActiveDocument.ActiveWindow.View.ShowFieldCodes = False
Selection.MoveRight Unit:=wdCharacter, Count:=1
End Sub


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


macropod wrote:
Your task, should you choose to accept it, is to create a
Charformat option ... that runs from the Field|Insert dialogue.

"Graham Mayor" wrote in message
...
The following macro

Sub InsertField()
SendKeys "{Tab}{Tab} +{Tab}+{Tab}"
Dialogs(wdDialogInsertField).Show
End Sub

will open the InsertField dialog with the 'preserve formatting'
option unchecked. It works in Word 2003 also.
Given that I can think of few circumstances where the mergeformat
switch is actually helpful, I use this on all my Word
installations. Now why couldn't we have had a charformat switch
option instead? --

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



macropod wrote:
Hi bsharp,

Sorry, the 'preserve formatting' option is only displayed via
the right-click or when you use Insert|Field.

"bsharp" wrote in message
...
Thanks, first part of your tip worked great.

I don't see an option to uncheck the 'preserve formatting'
option. I was entering "ref Date" and then selecting both
words, then hitting ctl-F9. Then I tried inserting a cross
reference, choosing bookmark, then
choosing the appropriate bookmark, but I don't see an option
about preserving formatting.

I did just find another way to do it, if I right-click on the
cross-reference, then choose edit field, there is a box checked
to preserve formatting that I can uncheck. So that is a little
quicker way to handle the first part of your tip.

"macropod" wrote:

Hi bsharp,

Press Alt-F9 to expose the field codes. Your cross-references
will look like {REF _123456789 \* MERGEFORMAT} or {REF
_123456789 \* MERGEFORMAT \h}. Delete the '\* MERGEFORMAT'
string and press F9. When you're finished, press Alt-F9 again.
For future reference, uncheck the 'preserve formatting' option
when inserting cross-references. --
Cheers
macropod
[MVP - Microsoft Word]


"bsharp" wrote in message
...
I am using Word 2007.

I have cross-references back to bookmarks through a 10 page
document. All the sources are on the first page.

When I put a cross-reference on the first page, formatting
comes out fine, even when data is updated.

On SOME of the other pages, the formatting changes. And it's
even within the field, for example, on a date field the month
will be a smaller font size than the day, and the day and
year may be
bold. Doesn't seem to matter what I format the source as.
When I format the references, it will take, but then change when
updated.




  #13   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default How to preserve format on cross-references when update

My original post in this thread did that - I merely rose to your bait.
The macro sets the switch initially to off, but when it is set to on it
gives the user the choice of mergeformat or charformat. Nothing more
Personally I find that a useful addition, though in practice I tend to
insert fields from the keyboard.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



macropod wrote:
Hi Graham,

OK, but except for the fact that you've added the Charformat switch
(which presumably will prevent the sometimes-reported occurrence of
Word inserting an unwanted Mergeformat switch), I don't see that
you've actually accomplished much more than what you'd get by simply
deleting the Mergeformat switch, for which see Jay Freedman's post
at:
http://www.officekb.com/Uwe/Forum.as...Field-defaults
which I've reporduced below.

Sub InsertFieldNoMergeFmt()
With Dialogs(wdDialogInsertField)
SendKeys "%v": .Show
End With
End Sub


"Graham Mayor" wrote in message
...
He can add it to the inserted field - just like any other
formatting. The charformat switch would ensure it stays thus when
the field is updated. While the code was merely an exercise to a see
if it could be done,
I quite like the result so I am now using it. I feel another
addition to my web site coming on --

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



macropod wrote:
Ah, but what if the user wants something different to emphasise the
link (eg a character style, or hard formatting)?

"Graham Mayor" wrote in message
...
If a user makes proper use of styles, ALL of the field will be
formatted with the required format and the field content will match
the rest of the line.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



macropod wrote:
Hi Graham,

That's a good start, but for the Charformat switch to be useful,
you also need to give the user all the normal font controls over
the first field description character, which is usually the 2nd
character in the field.

"Graham Mayor" wrote in message
...
How about

Sub InsertField()
Dim oRng As Range
Dim i As Variant
Dim sSwitch As String
Dim strChoice As String
SendKeys "{Tab}{Tab} +{Tab}+{Tab}"
Dialogs(wdDialogInsertField).Show
ActiveDocument.ActiveWindow.View.ShowFieldCodes = True
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Set oRng = Selection.Range
For i = 1 To oRng.Fields.Count
With oRng.Fields(i)
If InStr(1, .Code, "MERGEFORMAT") 0 Then
sSwitch = MsgBox("Use charformat in place of
mergeformat switch?", _ vbYesNo, _
"Insert Field")
If sSwitch = vbYes Then
.Code.Text = Replace(.Code.Text, _
"MERGEFORMAT", _
"CHARFORMAT")
End If
End If
.Update
End With
Next i
ActiveDocument.ActiveWindow.View.ShowFieldCodes = False
Selection.MoveRight Unit:=wdCharacter, Count:=1
End Sub


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


macropod wrote:
Your task, should you choose to accept it, is to create a
Charformat option ... that runs from the Field|Insert dialogue.

"Graham Mayor" wrote in message
...
The following macro

Sub InsertField()
SendKeys "{Tab}{Tab} +{Tab}+{Tab}"
Dialogs(wdDialogInsertField).Show
End Sub

will open the InsertField dialog with the 'preserve formatting'
option unchecked. It works in Word 2003 also.
Given that I can think of few circumstances where the
mergeformat switch is actually helpful, I use this on all my
Word installations. Now why couldn't we have had a charformat
switch option instead? --

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



macropod wrote:
Hi bsharp,

Sorry, the 'preserve formatting' option is only displayed via
the right-click or when you use Insert|Field.

"bsharp" wrote in message
...
Thanks, first part of your tip worked great.

I don't see an option to uncheck the 'preserve formatting'
option. I was entering "ref Date" and then selecting both
words, then hitting ctl-F9. Then I tried inserting a cross
reference, choosing bookmark, then
choosing the appropriate bookmark, but I don't see an option
about preserving formatting.

I did just find another way to do it, if I right-click on the
cross-reference, then choose edit field, there is a box
checked to preserve formatting that I can uncheck. So that
is a little quicker way to handle the first part of your tip.

"macropod" wrote:

Hi bsharp,

Press Alt-F9 to expose the field codes. Your
cross-references will look like {REF _123456789 \*
MERGEFORMAT} or {REF _123456789 \* MERGEFORMAT \h}. Delete
the '\* MERGEFORMAT' string and press F9. When you're
finished, press Alt-F9 again. For future reference, uncheck
the 'preserve formatting' option when inserting
cross-references. --
Cheers
macropod
[MVP - Microsoft Word]


"bsharp" wrote in message
...
I am using Word 2007.

I have cross-references back to bookmarks through a 10 page
document. All the sources are on the first page.

When I put a cross-reference on the first page, formatting
comes out fine, even when data is updated.

On SOME of the other pages, the formatting changes. And
it's even within the field, for example, on a date field
the month will be a smaller font size than the day, and
the day and year may be
bold. Doesn't seem to matter what I format the source as.
When I format the references, it will take, but then
change when updated.



  #14   Report Post  
Posted to microsoft.public.word.docmanagement
macropod[_2_] macropod[_2_] is offline
external usenet poster
 
Posts: 2,059
Default How to preserve format on cross-references when update

.. in practice I tend to insert fields from the keyboard.
Likewise. It's much quicker once you know what you're doing.

--
Cheers
macropod
[MVP - Microsoft Word]


"Graham Mayor" wrote in message ...
My original post in this thread did that - I merely rose to your bait.
The macro sets the switch initially to off, but when it is set to on it
gives the user the choice of mergeformat or charformat. Nothing more
Personally I find that a useful addition, though in practice I tend to
insert fields from the keyboard.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



macropod wrote:
Hi Graham,

OK, but except for the fact that you've added the Charformat switch
(which presumably will prevent the sometimes-reported occurrence of
Word inserting an unwanted Mergeformat switch), I don't see that
you've actually accomplished much more than what you'd get by simply
deleting the Mergeformat switch, for which see Jay Freedman's post
at:
http://www.officekb.com/Uwe/Forum.as...Field-defaults
which I've reporduced below.

Sub InsertFieldNoMergeFmt()
With Dialogs(wdDialogInsertField)
SendKeys "%v": .Show
End With
End Sub


"Graham Mayor" wrote in message
...
He can add it to the inserted field - just like any other
formatting. The charformat switch would ensure it stays thus when
the field is updated. While the code was merely an exercise to a see
if it could be done,
I quite like the result so I am now using it. I feel another
addition to my web site coming on --

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



macropod wrote:
Ah, but what if the user wants something different to emphasise the
link (eg a character style, or hard formatting)?

"Graham Mayor" wrote in message
...
If a user makes proper use of styles, ALL of the field will be
formatted with the required format and the field content will match
the rest of the line.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



macropod wrote:
Hi Graham,

That's a good start, but for the Charformat switch to be useful,
you also need to give the user all the normal font controls over
the first field description character, which is usually the 2nd
character in the field.

"Graham Mayor" wrote in message
...
How about

Sub InsertField()
Dim oRng As Range
Dim i As Variant
Dim sSwitch As String
Dim strChoice As String
SendKeys "{Tab}{Tab} +{Tab}+{Tab}"
Dialogs(wdDialogInsertField).Show
ActiveDocument.ActiveWindow.View.ShowFieldCodes = True
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Set oRng = Selection.Range
For i = 1 To oRng.Fields.Count
With oRng.Fields(i)
If InStr(1, .Code, "MERGEFORMAT") 0 Then
sSwitch = MsgBox("Use charformat in place of
mergeformat switch?", _ vbYesNo, _
"Insert Field")
If sSwitch = vbYes Then
.Code.Text = Replace(.Code.Text, _
"MERGEFORMAT", _
"CHARFORMAT")
End If
End If
.Update
End With
Next i
ActiveDocument.ActiveWindow.View.ShowFieldCodes = False
Selection.MoveRight Unit:=wdCharacter, Count:=1
End Sub


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


macropod wrote:
Your task, should you choose to accept it, is to create a
Charformat option ... that runs from the Field|Insert dialogue.

"Graham Mayor" wrote in message
...
The following macro

Sub InsertField()
SendKeys "{Tab}{Tab} +{Tab}+{Tab}"
Dialogs(wdDialogInsertField).Show
End Sub

will open the InsertField dialog with the 'preserve formatting'
option unchecked. It works in Word 2003 also.
Given that I can think of few circumstances where the
mergeformat switch is actually helpful, I use this on all my
Word installations. Now why couldn't we have had a charformat
switch option instead? --

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



macropod wrote:
Hi bsharp,

Sorry, the 'preserve formatting' option is only displayed via
the right-click or when you use Insert|Field.

"bsharp" wrote in message
...
Thanks, first part of your tip worked great.

I don't see an option to uncheck the 'preserve formatting'
option. I was entering "ref Date" and then selecting both
words, then hitting ctl-F9. Then I tried inserting a cross
reference, choosing bookmark, then
choosing the appropriate bookmark, but I don't see an option
about preserving formatting.

I did just find another way to do it, if I right-click on the
cross-reference, then choose edit field, there is a box
checked to preserve formatting that I can uncheck. So that
is a little quicker way to handle the first part of your tip.

"macropod" wrote:

Hi bsharp,

Press Alt-F9 to expose the field codes. Your
cross-references will look like {REF _123456789 \*
MERGEFORMAT} or {REF _123456789 \* MERGEFORMAT \h}. Delete
the '\* MERGEFORMAT' string and press F9. When you're
finished, press Alt-F9 again. For future reference, uncheck
the 'preserve formatting' option when inserting
cross-references. --
Cheers
macropod
[MVP - Microsoft Word]


"bsharp" wrote in message
...
I am using Word 2007.

I have cross-references back to bookmarks through a 10 page
document. All the sources are on the first page.

When I put a cross-reference on the first page, formatting
comes out fine, even when data is updated.

On SOME of the other pages, the formatting changes. And
it's even within the field, for example, on a date field
the month will be a smaller font size than the day, and
the day and year may be
bold. Doesn't seem to matter what I format the source as.
When I format the references, it will take, but then
change when updated.



  #15   Report Post  
Posted to microsoft.public.word.docmanagement
macropod[_2_] macropod[_2_] is offline
external usenet poster
 
Posts: 2,059
Default How to preserve format on cross-references when update

Hi Graham,

A serious fly in the ointment: SendKeys doesn't work under Vista - it returns error code 70: "Permission denied".

--
Cheers
macropod
[MVP - Microsoft Word]


"Graham Mayor" wrote in message ...
My original post in this thread did that - I merely rose to your bait.
The macro sets the switch initially to off, but when it is set to on it
gives the user the choice of mergeformat or charformat. Nothing more
Personally I find that a useful addition, though in practice I tend to
insert fields from the keyboard.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



macropod wrote:
Hi Graham,

OK, but except for the fact that you've added the Charformat switch
(which presumably will prevent the sometimes-reported occurrence of
Word inserting an unwanted Mergeformat switch), I don't see that
you've actually accomplished much more than what you'd get by simply
deleting the Mergeformat switch, for which see Jay Freedman's post
at:
http://www.officekb.com/Uwe/Forum.as...Field-defaults
which I've reporduced below.

Sub InsertFieldNoMergeFmt()
With Dialogs(wdDialogInsertField)
SendKeys "%v": .Show
End With
End Sub


"Graham Mayor" wrote in message
...
He can add it to the inserted field - just like any other
formatting. The charformat switch would ensure it stays thus when
the field is updated. While the code was merely an exercise to a see
if it could be done,
I quite like the result so I am now using it. I feel another
addition to my web site coming on --

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



macropod wrote:
Ah, but what if the user wants something different to emphasise the
link (eg a character style, or hard formatting)?

"Graham Mayor" wrote in message
...
If a user makes proper use of styles, ALL of the field will be
formatted with the required format and the field content will match
the rest of the line.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



macropod wrote:
Hi Graham,

That's a good start, but for the Charformat switch to be useful,
you also need to give the user all the normal font controls over
the first field description character, which is usually the 2nd
character in the field.

"Graham Mayor" wrote in message
...
How about

Sub InsertField()
Dim oRng As Range
Dim i As Variant
Dim sSwitch As String
Dim strChoice As String
SendKeys "{Tab}{Tab} +{Tab}+{Tab}"
Dialogs(wdDialogInsertField).Show
ActiveDocument.ActiveWindow.View.ShowFieldCodes = True
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Set oRng = Selection.Range
For i = 1 To oRng.Fields.Count
With oRng.Fields(i)
If InStr(1, .Code, "MERGEFORMAT") 0 Then
sSwitch = MsgBox("Use charformat in place of
mergeformat switch?", _ vbYesNo, _
"Insert Field")
If sSwitch = vbYes Then
.Code.Text = Replace(.Code.Text, _
"MERGEFORMAT", _
"CHARFORMAT")
End If
End If
.Update
End With
Next i
ActiveDocument.ActiveWindow.View.ShowFieldCodes = False
Selection.MoveRight Unit:=wdCharacter, Count:=1
End Sub


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


macropod wrote:
Your task, should you choose to accept it, is to create a
Charformat option ... that runs from the Field|Insert dialogue.

"Graham Mayor" wrote in message
...
The following macro

Sub InsertField()
SendKeys "{Tab}{Tab} +{Tab}+{Tab}"
Dialogs(wdDialogInsertField).Show
End Sub

will open the InsertField dialog with the 'preserve formatting'
option unchecked. It works in Word 2003 also.
Given that I can think of few circumstances where the
mergeformat switch is actually helpful, I use this on all my
Word installations. Now why couldn't we have had a charformat
switch option instead? --

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



macropod wrote:
Hi bsharp,

Sorry, the 'preserve formatting' option is only displayed via
the right-click or when you use Insert|Field.

"bsharp" wrote in message
...
Thanks, first part of your tip worked great.

I don't see an option to uncheck the 'preserve formatting'
option. I was entering "ref Date" and then selecting both
words, then hitting ctl-F9. Then I tried inserting a cross
reference, choosing bookmark, then
choosing the appropriate bookmark, but I don't see an option
about preserving formatting.

I did just find another way to do it, if I right-click on the
cross-reference, then choose edit field, there is a box
checked to preserve formatting that I can uncheck. So that
is a little quicker way to handle the first part of your tip.

"macropod" wrote:

Hi bsharp,

Press Alt-F9 to expose the field codes. Your
cross-references will look like {REF _123456789 \*
MERGEFORMAT} or {REF _123456789 \* MERGEFORMAT \h}. Delete
the '\* MERGEFORMAT' string and press F9. When you're
finished, press Alt-F9 again. For future reference, uncheck
the 'preserve formatting' option when inserting
cross-references. --
Cheers
macropod
[MVP - Microsoft Word]


"bsharp" wrote in message
...
I am using Word 2007.

I have cross-references back to bookmarks through a 10 page
document. All the sources are on the first page.

When I put a cross-reference on the first page, formatting
comes out fine, even when data is updated.

On SOME of the other pages, the formatting changes. And
it's even within the field, for example, on a date field
the month will be a smaller font size than the day, and
the day and year may be
bold. Doesn't seem to matter what I format the source as.
When I format the references, it will take, but then
change when updated.





  #16   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default How to preserve format on cross-references when update

Why am I not surprised?

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



macropod wrote:
Hi Graham,

A serious fly in the ointment: SendKeys doesn't work under Vista - it
returns error code 70: "Permission denied".

"Graham Mayor" wrote in message
...
My original post in this thread did that - I merely rose to your
bait. The macro sets the switch initially to off, but when it is set
to on it gives the user the choice of mergeformat or charformat.
Nothing more Personally I find that a useful addition, though in
practice I tend to insert fields from the keyboard.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



macropod wrote:
Hi Graham,

OK, but except for the fact that you've added the Charformat switch
(which presumably will prevent the sometimes-reported occurrence of
Word inserting an unwanted Mergeformat switch), I don't see that
you've actually accomplished much more than what you'd get by simply
deleting the Mergeformat switch, for which see Jay Freedman's post
at:
http://www.officekb.com/Uwe/Forum.as...Field-defaults
which I've reporduced below.

Sub InsertFieldNoMergeFmt()
With Dialogs(wdDialogInsertField)
SendKeys "%v": .Show
End With
End Sub


"Graham Mayor" wrote in message
...
He can add it to the inserted field - just like any other
formatting. The charformat switch would ensure it stays thus when
the field is updated. While the code was merely an exercise to
a see if it could be done,
I quite like the result so I am now using it. I feel another
addition to my web site coming on --

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



macropod wrote:
Ah, but what if the user wants something different to emphasise
the link (eg a character style, or hard formatting)?

"Graham Mayor" wrote in message
...
If a user makes proper use of styles, ALL of the field will be
formatted with the required format and the field content will
match the rest of the line.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



macropod wrote:
Hi Graham,

That's a good start, but for the Charformat switch to be useful,
you also need to give the user all the normal font controls over
the first field description character, which is usually the 2nd
character in the field.

"Graham Mayor" wrote in message
...
How about

Sub InsertField()
Dim oRng As Range
Dim i As Variant
Dim sSwitch As String
Dim strChoice As String
SendKeys "{Tab}{Tab} +{Tab}+{Tab}"
Dialogs(wdDialogInsertField).Show
ActiveDocument.ActiveWindow.View.ShowFieldCodes = True
Selection.MoveLeft Unit:=wdCharacter, Count:=1,
Extend:=wdExtend Set oRng = Selection.Range
For i = 1 To oRng.Fields.Count
With oRng.Fields(i)
If InStr(1, .Code, "MERGEFORMAT") 0 Then
sSwitch = MsgBox("Use charformat in place of
mergeformat switch?", _ vbYesNo, _
"Insert Field")
If sSwitch = vbYes Then
.Code.Text = Replace(.Code.Text, _
"MERGEFORMAT", _
"CHARFORMAT")
End If
End If
.Update
End With
Next i
ActiveDocument.ActiveWindow.View.ShowFieldCodes = False
Selection.MoveRight Unit:=wdCharacter, Count:=1
End Sub


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


macropod wrote:
Your task, should you choose to accept it, is to create a
Charformat option ... that runs from the Field|Insert
dialogue. "Graham Mayor" wrote in
message
...
The following macro

Sub InsertField()
SendKeys "{Tab}{Tab} +{Tab}+{Tab}"
Dialogs(wdDialogInsertField).Show
End Sub

will open the InsertField dialog with the 'preserve
formatting' option unchecked. It works in Word 2003 also.
Given that I can think of few circumstances where the
mergeformat switch is actually helpful, I use this on all my
Word installations. Now why couldn't we have had a charformat
switch option instead? --

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



macropod wrote:
Hi bsharp,

Sorry, the 'preserve formatting' option is only displayed
via the right-click or when you use Insert|Field.

"bsharp" wrote in message
...
Thanks, first part of your tip worked great.

I don't see an option to uncheck the 'preserve formatting'
option. I was entering "ref Date" and then selecting both
words, then hitting ctl-F9. Then I tried inserting a cross
reference, choosing bookmark, then
choosing the appropriate bookmark, but I don't see an
option about preserving formatting.

I did just find another way to do it, if I right-click on
the cross-reference, then choose edit field, there is a box
checked to preserve formatting that I can uncheck. So that
is a little quicker way to handle the first part of your
tip. "macropod" wrote:

Hi bsharp,

Press Alt-F9 to expose the field codes. Your
cross-references will look like {REF _123456789 \*
MERGEFORMAT} or {REF _123456789 \* MERGEFORMAT \h}. Delete
the '\* MERGEFORMAT' string and press F9. When you're
finished, press Alt-F9 again. For future reference,
uncheck the 'preserve formatting' option when inserting
cross-references. --
Cheers
macropod
[MVP - Microsoft Word]


"bsharp" wrote in
message
...
I am using Word 2007.

I have cross-references back to bookmarks through a 10
page document. All the sources are on the first page.

When I put a cross-reference on the first page,
formatting comes out fine, even when data is updated.

On SOME of the other pages, the formatting changes. And
it's even within the field, for example, on a date field
the month will be a smaller font size than the day, and
the day and year may be
bold. Doesn't seem to matter what I format the source as.
When I format the references, it will take, but then
change when updated.



  #17   Report Post  
Posted to microsoft.public.word.docmanagement
macropod[_2_] macropod[_2_] is offline
external usenet poster
 
Posts: 2,059
Default How to preserve format on cross-references when update

How many guesses do I get?

--
Cheers
macropod
[MVP - Microsoft Word]


"Graham Mayor" wrote in message ...
Why am I not surprised?

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



macropod wrote:
Hi Graham,

A serious fly in the ointment: SendKeys doesn't work under Vista - it
returns error code 70: "Permission denied".

"Graham Mayor" wrote in message
...
My original post in this thread did that - I merely rose to your
bait. The macro sets the switch initially to off, but when it is set
to on it gives the user the choice of mergeformat or charformat.
Nothing more Personally I find that a useful addition, though in
practice I tend to insert fields from the keyboard.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



macropod wrote:
Hi Graham,

OK, but except for the fact that you've added the Charformat switch
(which presumably will prevent the sometimes-reported occurrence of
Word inserting an unwanted Mergeformat switch), I don't see that
you've actually accomplished much more than what you'd get by simply
deleting the Mergeformat switch, for which see Jay Freedman's post
at:
http://www.officekb.com/Uwe/Forum.as...Field-defaults
which I've reporduced below.

Sub InsertFieldNoMergeFmt()
With Dialogs(wdDialogInsertField)
SendKeys "%v": .Show
End With
End Sub


"Graham Mayor" wrote in message
...
He can add it to the inserted field - just like any other
formatting. The charformat switch would ensure it stays thus when
the field is updated. While the code was merely an exercise to
a see if it could be done,
I quite like the result so I am now using it. I feel another
addition to my web site coming on --

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



macropod wrote:
Ah, but what if the user wants something different to emphasise
the link (eg a character style, or hard formatting)?

"Graham Mayor" wrote in message
...
If a user makes proper use of styles, ALL of the field will be
formatted with the required format and the field content will
match the rest of the line.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



macropod wrote:
Hi Graham,

That's a good start, but for the Charformat switch to be useful,
you also need to give the user all the normal font controls over
the first field description character, which is usually the 2nd
character in the field.

"Graham Mayor" wrote in message
...
How about

Sub InsertField()
Dim oRng As Range
Dim i As Variant
Dim sSwitch As String
Dim strChoice As String
SendKeys "{Tab}{Tab} +{Tab}+{Tab}"
Dialogs(wdDialogInsertField).Show
ActiveDocument.ActiveWindow.View.ShowFieldCodes = True
Selection.MoveLeft Unit:=wdCharacter, Count:=1,
Extend:=wdExtend Set oRng = Selection.Range
For i = 1 To oRng.Fields.Count
With oRng.Fields(i)
If InStr(1, .Code, "MERGEFORMAT") 0 Then
sSwitch = MsgBox("Use charformat in place of
mergeformat switch?", _ vbYesNo, _
"Insert Field")
If sSwitch = vbYes Then
.Code.Text = Replace(.Code.Text, _
"MERGEFORMAT", _
"CHARFORMAT")
End If
End If
.Update
End With
Next i
ActiveDocument.ActiveWindow.View.ShowFieldCodes = False
Selection.MoveRight Unit:=wdCharacter, Count:=1
End Sub


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


macropod wrote:
Your task, should you choose to accept it, is to create a
Charformat option ... that runs from the Field|Insert
dialogue. "Graham Mayor" wrote in
message
...
The following macro

Sub InsertField()
SendKeys "{Tab}{Tab} +{Tab}+{Tab}"
Dialogs(wdDialogInsertField).Show
End Sub

will open the InsertField dialog with the 'preserve
formatting' option unchecked. It works in Word 2003 also.
Given that I can think of few circumstances where the
mergeformat switch is actually helpful, I use this on all my
Word installations. Now why couldn't we have had a charformat
switch option instead? --

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



macropod wrote:
Hi bsharp,

Sorry, the 'preserve formatting' option is only displayed
via the right-click or when you use Insert|Field.

"bsharp" wrote in message
...
Thanks, first part of your tip worked great.

I don't see an option to uncheck the 'preserve formatting'
option. I was entering "ref Date" and then selecting both
words, then hitting ctl-F9. Then I tried inserting a cross
reference, choosing bookmark, then
choosing the appropriate bookmark, but I don't see an
option about preserving formatting.

I did just find another way to do it, if I right-click on
the cross-reference, then choose edit field, there is a box
checked to preserve formatting that I can uncheck. So that
is a little quicker way to handle the first part of your
tip. "macropod" wrote:

Hi bsharp,

Press Alt-F9 to expose the field codes. Your
cross-references will look like {REF _123456789 \*
MERGEFORMAT} or {REF _123456789 \* MERGEFORMAT \h}. Delete
the '\* MERGEFORMAT' string and press F9. When you're
finished, press Alt-F9 again. For future reference,
uncheck the 'preserve formatting' option when inserting
cross-references. --
Cheers
macropod
[MVP - Microsoft Word]


"bsharp" wrote in
message
...
I am using Word 2007.

I have cross-references back to bookmarks through a 10
page document. All the sources are on the first page.

When I put a cross-reference on the first page,
formatting comes out fine, even when data is updated.

On SOME of the other pages, the formatting changes. And
it's even within the field, for example, on a date field
the month will be a smaller font size than the day, and
the day and year may be
bold. Doesn't seem to matter what I format the source as.
When I format the references, it will take, but then
change when updated.



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
Update of cross references with track changes on Alessandro Triglia Microsoft Word Help 1 June 18th 08 09:53 AM
cross references fail to update grammatim[_2_] Microsoft Word Help 3 January 22nd 08 11:04 PM
How do I update cross references without them disappearing? jen_writer Microsoft Word Help 2 August 1st 06 09:15 PM
Cross references won't update. ConĂ¡n Microsoft Word Help 4 March 23rd 06 04:02 PM
word cross references do not update Seb Tables 6 August 22nd 05 05:18 PM


All times are GMT +1. The time now is 08:40 PM.

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"