D
David Thielen
I call the following code where Range.Start == Range.End and it is
sitting at the end of a paragraph. There is no ContentControl anywhere
nearby. Range.ContentControls.Count == 0.
This occurs when I first delete a Field at this location, than add the
ContentControl. It appears to only be a problem when this happens at
the end of a paragraph.
object obj = rng;
ContentControl ctrl =
rng.ContentControls.Add(WdContentControlType.wdContentControlText, ref
obj);
The error I get is:
System.Runtime.InteropServices.COMException occurred
HelpLink="C:\\Program Files\\Microsoft
Office\\Office12\\1033\\WDMAIN11.CHM#37373"
Message="This method or property is not available because the
current selection partially covers a plain text content control."
Source="Microsoft Word"
ErrorCode=-2146823683
StackTrace:
at
Microsoft.Office.Interop.Word.ContentControls.Add(WdContentControlType
Type, Object& Range)
at
AutoTag2010.net.windward.autotag.word.WordTagHandler.WriteTag(WordTagLocation
tag, Image picture, ChartDataSet chartData) in
C:\src\version9\AutoTag\AutoTag2010\net\windward\autotag\word\WordTagHandler.cs:line
1465
InnerException:
??? - thanks - dave
david@[email protected]
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com
Cubicle Wars - http://www.windwardreports.com/film.htm
sitting at the end of a paragraph. There is no ContentControl anywhere
nearby. Range.ContentControls.Count == 0.
This occurs when I first delete a Field at this location, than add the
ContentControl. It appears to only be a problem when this happens at
the end of a paragraph.
object obj = rng;
ContentControl ctrl =
rng.ContentControls.Add(WdContentControlType.wdContentControlText, ref
obj);
The error I get is:
System.Runtime.InteropServices.COMException occurred
HelpLink="C:\\Program Files\\Microsoft
Office\\Office12\\1033\\WDMAIN11.CHM#37373"
Message="This method or property is not available because the
current selection partially covers a plain text content control."
Source="Microsoft Word"
ErrorCode=-2146823683
StackTrace:
at
Microsoft.Office.Interop.Word.ContentControls.Add(WdContentControlType
Type, Object& Range)
at
AutoTag2010.net.windward.autotag.word.WordTagHandler.WriteTag(WordTagLocation
tag, Image picture, ChartDataSet chartData) in
C:\src\version9\AutoTag\AutoTag2010\net\windward\autotag\word\WordTagHandler.cs:line
1465
InnerException:
??? - thanks - dave
david@[email protected]
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com
Cubicle Wars - http://www.windwardreports.com/film.htm