Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-12-2014, 02:54 AM
NobodysPerfect NobodysPerfect is offline Word adds additional stupid \* MERGEFORMAT Windows 8 Word adds additional stupid \* MERGEFORMAT Office 2010 32bit
Competent Performer
Word adds additional stupid \* MERGEFORMAT
 
Join Date: Jan 2014
Location: Germany
Posts: 136
NobodysPerfect is on a distinguished road
Default Word adds additional stupid \* MERGEFORMAT

Hi to all,

I never ever use the \* MERGEFORMAT switch in e.g. { REF } fields, I use \* CHARFORMAT instead.

But if whatever character formatting is applied, Word adds the \* MERGEFORMAT switch - even in addition to an existing \* CHARFORMAT. I really never noticed that before .

In the undo list the last two steps (in reverse order) are 1. "Character formatting" and 2. "Update automatically" (maybe the English terms are slightly different).

Undo "Update automatically" removes the inserted \* MERGEFORMAT.

As I do not like to have any \* MERGEFORMAT switch in my documents my question: Can I stop Word from inserting that stupid switch?



Thanks in advance
NP
Reply With Quote
  #2  
Old 10-12-2014, 09:15 AM
Charles Kenyon Charles Kenyon is offline Word adds additional stupid \* MERGEFORMAT Windows 7 64bit Word adds additional stupid \* MERGEFORMAT Office 2010 32bit
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,138
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

I don't know that it is possible to completely eliminate it. However, the following code sets the default when you add a field through Insert>Quick Parts>Fields is to have the box to insert it uinchecked.

I have it installed in an Add-In.
Code:
Sub InsertField()
'   Graham Mayor vba samples
'   Intercepts InsertField command and removes MERGEFORMAT default
'   Allows CHARFORMAT switch option
'
    Dim oRng As Range, i As Variant, sSwitch As String, strChoice As String
    '
    ' Uncheck box to insert MERGEFORMAT
    '
    SendKeys "{Tab 2} +{Tab 2}"
    '
    Dialogs(wdDialogInsertField).Show
    On Error GoTo Finish 'User has cancelled
    '
    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 the 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
    Selection.MoveRight Unit:=wdCharacter, Count:=1
Finish:
End Sub

If you do check the box, it asks if you want CharFormat instead.
Reply With Quote
  #3  
Old 10-12-2014, 09:48 AM
NobodysPerfect NobodysPerfect is offline Word adds additional stupid \* MERGEFORMAT Windows 8 Word adds additional stupid \* MERGEFORMAT Office 2010 32bit
Competent Performer
Word adds additional stupid \* MERGEFORMAT
 
Join Date: Jan 2014
Location: Germany
Posts: 136
NobodysPerfect is on a distinguished road
Default

Hi Charles,

Thanks, for your answer, but that does not really solve my problem.

I do in fact only use \* Charformat (use my own macros), but whenever I change e.g. the font size or use bold or italic formatting, a \* Mergeformat is added (even into a field with \* Charformat switch):

{ REF Name \* CHARFORMAT \* MERGEFORMAT }

Unfortunately \* M seems so 'overrule \* C which means, first character \* C formatting doesn't work anymore. You can format the first character of the field, but the formatting will not take effect unless you delete the added \* M switch.

When changing the character formatting, according to the undo list, two commands are carried out: a) formatting and b) field update (including adding the \* M switch).

Any other ideas ?

NP
Reply With Quote
  #4  
Old 10-12-2014, 03:31 PM
macropod's Avatar
macropod macropod is offline Word adds additional stupid \* MERGEFORMAT Windows 7 64bit Word adds additional stupid \* MERGEFORMAT Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Unfortunately, whenever you hard-format a cross-reference, Word 'helpfully' adds the MERGEFORMAT switch. The simplest solution is to toggle the field code display 'on' (e.g. via Alt-F9), then use Find/Replace to delete the switches, via:
Find = \* MERGEFORMAT<space>
Replace = nothing

Do note that, when adding the \* CHARFORMAT switch, you need only format the first character of the field code, in this case the 'R' of the field's 'REF' expression. There is no need to format anything else. Not applying the format to the whole field will avoid the addition of the extraneous \* MERGEFORMAT switch.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 10-12-2014, 04:36 PM
NobodysPerfect NobodysPerfect is offline Word adds additional stupid \* MERGEFORMAT Windows 8 Word adds additional stupid \* MERGEFORMAT Office 2010 32bit
Competent Performer
Word adds additional stupid \* MERGEFORMAT
 
Join Date: Jan 2014
Location: Germany
Posts: 136
NobodysPerfect is on a distinguished road
Default

Hi Paul,

Quote:
Unfortunately, whenever you hard-format a cross-reference, Word 'helpfully' adds the MERGEFORMAT switch.
Another helpful feature to cope with ...

Quote:
then use Find/Replace to delete the switches, via:
Find = \* MERGEFORMAT<space>
Replace = nothing
That's of course the fastest way, but an additional step ...

Quote:
Do note that, when adding the \* CHARFORMAT switch, you need only format the first character of the field code, in this case the 'R' of the field's 'REF' expression.
My crossreference macro only formats the first character of the { REF } fields ({ REF Name \* Charformat }, but nevertheless ...
Quote:
Not applying the format to the whole field will avoid the addition of the extraneous \* MERGEFORMAT switch.
... Word keeps adding the \* MERGEFORMAT switch.


Seem to be one of those features "resulting from far too many Tia Marias laced with vodka" (http://word.mvps.org/faqs/tblsfldsfms/FastTables.htm).

NP
Reply With Quote
  #6  
Old 10-12-2014, 05:26 PM
Charles Kenyon Charles Kenyon is offline Word adds additional stupid \* MERGEFORMAT Windows 7 64bit Word adds additional stupid \* MERGEFORMAT Office 2010 32bit
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,138
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

Quote:
Originally Posted by NobodysPerfect View Post
Hi Charles,

Thanks, for your answer, but that does not really solve my problem.

I do in fact only use \* Charformat (use my own macros), but whenever I change e.g. the font size or use bold or italic formatting, a \* Mergeformat is added (even into a field with \* Charformat switch):

{ REF Name \* CHARFORMAT \* MERGEFORMAT }

Unfortunately \* M seems so 'overrule \* C which means, first character \* C formatting doesn't work anymore. You can format the first character of the field, but the formatting will not take effect unless you delete the added \* M switch.

When changing the character formatting, according to the undo list, two commands are carried out: a) formatting and b) field update (including adding the \* M switch).

Any other ideas ?

NP
A thought would be to reveal field codes and then do the formatting on that first character.
Reply With Quote
  #7  
Old 10-12-2014, 06:05 PM
macropod's Avatar
macropod macropod is offline Word adds additional stupid \* MERGEFORMAT Windows 7 64bit Word adds additional stupid \* MERGEFORMAT Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by NobodysPerfect View Post
My crossreference macro only formats the first character of the { REF } fields ({ REF Name \* Charformat }, but nevertheless ...
... Word keeps adding the \* MERGEFORMAT switch.
Without seeing your macro, I can't really comment on why it might be doing that.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #8  
Old 10-13-2014, 03:31 AM
NobodysPerfect NobodysPerfect is offline Word adds additional stupid \* MERGEFORMAT Windows 8 Word adds additional stupid \* MERGEFORMAT Office 2010 32bit
Competent Performer
Word adds additional stupid \* MERGEFORMAT
 
Join Date: Jan 2014
Location: Germany
Posts: 136
NobodysPerfect is on a distinguished road
Default

Hi Paul,

Quote:
Without seeing your macro, I can't really comment on why it might be doing that.
Adding \* M is completely independent from my cross reference macros which work like a charm.

I stumpled upon this 'feature' it when applying the field solution (https://www.msofficeforums.com/word/...est-empty.html) to my table.

When creating tables I often have to change table formatting until it fits my formatting ideas. Whenever I apply character formatting, the \* M switch is added to the { REF } fields. So I changed \* M to \*C, thought everything was fine and continued working. But Word still keeps inserting the \* M switch resulting in: { REF Text1 \* CHARFORMAT \* MERGEFORMAT }.

As soon as the \* M switch is inserted, the \* C switch becomes ineffective.

In the case of my table (and field formatting) it really does not matter, it is (was) more a sort of basic question.

NP

Last edited by NobodysPerfect; 10-13-2014 at 07:08 AM.
Reply With Quote
  #9  
Old 10-13-2014, 01:52 PM
macropod's Avatar
macropod macropod is offline Word adds additional stupid \* MERGEFORMAT Windows 7 64bit Word adds additional stupid \* MERGEFORMAT Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by NobodysPerfect View Post
When creating tables I often have to change table formatting until it fits my formatting ideas.
The problem, then, is that you're overriding the field's formatting when you change the table format. That's what's causing Word to add the \* MERGEFORMAT switch. IOW, it's behaving as intended.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Word adds additional stupid \* MERGEFORMAT I get this {shape \*mergeformat} when I select org chart from the Drawing toolbar. blockie Word 1 09-02-2014 02:15 PM
Word adds additional stupid \* MERGEFORMAT stupid ? but the one I ask anyway Rekitson Excel 2 04-19-2013 07:23 AM
Word adds additional stupid \* MERGEFORMAT { REF bmSubject \* MERGEFORMAT} In footer shodg001 Word 2 04-17-2013 11:49 PM
My list of stupid questions Niinie PowerPoint 1 10-05-2010 02:34 PM
Help - Word adds secret code? Copy to notepad? andytaylor2006 Word 0 12-15-2006 11:00 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:55 PM.


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