Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-24-2011, 05:24 PM
GLENCOE GLENCOE is offline double spaces in field ref (bookmarks) Windows XP double spaces in field ref (bookmarks) Office 2007
Novice
double spaces in field ref (bookmarks)
 
Join Date: Oct 2011
Location: Montreal, QC, Canada
Posts: 4
GLENCOE is on a distinguished road
Default double spaces in field ref (bookmarks)


A Ref field in Word (e.g. a bookmark) seems to have sometimes 2 consecutive spaces in its "definition". I was wondering if those 2 spaces are normal, useful and necessary.

Here is an example I have:

{ REF _Ref277582702 \h \* MERGEFORMAT }

You can see two spaces after the \h switch. If I remove one space, the bookmark is still working fine, but I am not sure if I am "allowed" to remove this space or not. I didn't find anything about it in the references on bookmarks and Ref fields.

If those 2 spaces are necessary, I will need help detecting in VBA how to find out that the cursor is in such a field or not.
Reply With Quote
  #2  
Old 10-25-2011, 03:14 AM
Stefan Blom's Avatar
Stefan Blom Stefan Blom is offline double spaces in field ref (bookmarks) Windows 7 64bit double spaces in field ref (bookmarks) Office 2010 32bit
Moderator
 
Join Date: Aug 2011
Posts: 3,907
Stefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to all
Default

With most fields, deleting extra spaces will do no harm. But with some calculated fields, or fields containing nested IF field constructs, the absence or presence of extra spaces may be crucial.
__________________
Stefan Blom
Microsoft Word MVP

Microsoft 365 apps for business
Windows 11 Professional

Last edited by Stefan Blom; 10-25-2011 at 10:14 AM.
Reply With Quote
  #3  
Old 10-25-2011, 04:23 AM
macropod's Avatar
macropod macropod is offline double spaces in field ref (bookmarks) Windows 7 64bit double spaces in field ref (bookmarks) 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

Hi Glencoe,

The field code you posted could be reduced to {REF _Ref277582702 \h} without harm. In general, the internal spacing within a simple field is inconsequential. Three exceptions are QUOTE, EQ and IF fields. With QUOTE and IF fields, double spaces between the double-quotes used to delimit the output will appear there. Other spaces in those field codes are inconsequential. With EQ fields, you generally need to ensure there are no spaces either side of the field code. With IF fields and other calculation fields, omitting the wrong spaces can have deleterious effects on how the expressions are evaluated and, hence, on their output - as Stefan says, their presence may be crucial.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #4  
Old 10-25-2011, 07:35 AM
GLENCOE GLENCOE is offline double spaces in field ref (bookmarks) Windows XP double spaces in field ref (bookmarks) Office 2007
Novice
double spaces in field ref (bookmarks)
 
Join Date: Oct 2011
Location: Montreal, QC, Canada
Posts: 4
GLENCOE is on a distinguished road
Default

Thanks Stefan and macropod for your answers. I have to check whether I need to work with QUOTE fields or not. My concern is that I am using a macro that deletes all double spaces in a Word file (and keeps only one space). In the example I gave, I didn't notice any harm indeed, but if, as you say, QUOTE fields or other kinds do need double spaces, then I will probably need to take care of this!
Reply With Quote
Reply

Tags
double space, field ref



Similar Threads
Thread Thread Starter Forum Replies Last Post
Get rid of leading spaces before paragraphs fig000 Word 11 03-14-2016 01:59 PM
double spaces in field ref (bookmarks) HELP - problem with disappearing spaces klanch Word 3 02-11-2011 10:32 AM
double spaces in field ref (bookmarks) Eliminate blanc spaces at the beginnig row Il_Fabietto Word VBA 9 06-26-2009 05:04 AM
Spaces After Each Word jnutella Word 0 03-04-2009 02:00 PM
Word to Excel hyperlinks and spaces gak Word 1 09-14-2008 08:38 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 07: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