Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 01-03-2017, 12:07 AM
MANOHAR MANOHAR is offline Spaces inside Fieldcode curly braces Windows 7 32bit Spaces inside Fieldcode curly braces Office 2007
Advanced Beginner
Spaces inside Fieldcode curly braces
 
Join Date: Jan 2017
Posts: 33
MANOHAR is on a distinguished road
Default Spaces inside Fieldcode curly braces

Hello,

We have a application where we have to count the length of the fieldcode text for which we are counting the text inside the InstrText tag which is working fine so far. But we are not able to calculate the fieldcode text of the internal hyperlink field. we using below code snippet to manually build instrText of the hyperlink field.

string HyperlinkFC = string.Empty;
if (element.Attributes().Any(a => a.Name.LocalName == “anchor”))
{
string s = @”HYPERLINK \l”;
HyperlinkFC = string.Format(” {0} \”{1}\” “, s, element.Attribute(W.anchor).Value);
}
fieldCodeText.Append(HyperlinkFC);

Above code is working fine for some cases like below:


{HYPERLINK \l “_Toc165886552”}

But it is failing for some cases where there is a trailing and leading white space inside the curly braces of Hyperlink fieldcode in the begining and end as below

{ HYPERLINK \l “_Toc165886552” }

It is giving 2 characters length difference than expected.

Could someone please tell me how to remove this trailing and leading white space inside curly braces?

Any help will be truly appreiciated!!

Regards,
Manohar
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Text inside text boxes create headings inside my table of contents!!! How do I delete the created he carstj Word 3 04-11-2016 12:46 PM
Spaces inside Fieldcode curly braces What does <!//FieldCode**> indicate? kopp123 Mail Merge 1 09-03-2015 10:03 PM
Straight Vs Curly Quotation Marks FOsmund Word 4 04-16-2015 01:48 PM
Replacing curly braces in a wildcard F&R Ulodesk Word 9 02-21-2014 07:28 AM
Balky Curly Quotes JamesT Word 0 01-23-2010 05:36 PM

Other Forums: Access Forums

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


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