D
David Thielen
On a DocumentChange event I call:
Range range = Selection.Range.Duplicate;
foreach (Shape item in range.ShapeRange) {
if (string.IsNullOrEmpty(item.AlternativeText) ||
((!item.AlternativeText.StartsWith("<wr:")) &&
(!item.AlternativeText.StartsWith("</wr:"))))
continue;
string xmlChart = item.Anchor.WordOpenXML;
....
}
The call to WordOpenXML throws the exception:
System.Runtime.InteropServices.COMException occurred
HelpLink="C:\\Program Files\\Microsoft
Office\\Office12\\1033\\WDMAIN11.CHM#25410"
Message="The object is not valid."
Source="Microsoft Word"
ErrorCode=-2146822358
StackTrace:
at Microsoft.Office.Interop.Word.Range.get_WordOpenXML()
at
AutoTag2010.net.windward.autotag.word.WordTagHandler.FindAllTags(Selection
selOn, Boolean justFirst, Int32 startSearch, Int32 endSearch) in
C:\src\version9\AutoTag\AutoTag2010\net\windward\autotag\word\WordTagHandler.cs:line
700
InnerException:
item.Anchor appears to be valid - item.AlternativeText can be read and
has the string I expect in it.
Why the error on this call? The shape is a chart.
david@[email protected]
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com
Cubicle Wars - http://www.windwardreports.com/film.htm
Range range = Selection.Range.Duplicate;
foreach (Shape item in range.ShapeRange) {
if (string.IsNullOrEmpty(item.AlternativeText) ||
((!item.AlternativeText.StartsWith("<wr:")) &&
(!item.AlternativeText.StartsWith("</wr:"))))
continue;
string xmlChart = item.Anchor.WordOpenXML;
....
}
The call to WordOpenXML throws the exception:
System.Runtime.InteropServices.COMException occurred
HelpLink="C:\\Program Files\\Microsoft
Office\\Office12\\1033\\WDMAIN11.CHM#25410"
Message="The object is not valid."
Source="Microsoft Word"
ErrorCode=-2146822358
StackTrace:
at Microsoft.Office.Interop.Word.Range.get_WordOpenXML()
at
AutoTag2010.net.windward.autotag.word.WordTagHandler.FindAllTags(Selection
selOn, Boolean justFirst, Int32 startSearch, Int32 endSearch) in
C:\src\version9\AutoTag\AutoTag2010\net\windward\autotag\word\WordTagHandler.cs:line
700
InnerException:
item.Anchor appears to be valid - item.AlternativeText can be read and
has the string I expect in it.
Why the error on this call? The shape is a chart.
david@[email protected]
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com
Cubicle Wars - http://www.windwardreports.com/film.htm