D
David Thielen
Hi;
This happens only if I try to add a field outside a table at the end of a
row (not in the cell, but outside the table after row 0 of a 2x3 table.
The code is:
object fieldType = WdFieldType.wdFieldAutoTextList;
object fieldText = "\"" + "<:forEach>" + "\"" + " \\t \"" +
"</wr:forEach>".Replace("\"", "\\\"") + "\"";
object preserveFormatting = false;
// note rng.Start = rng.End = 3 - get it from Selection
Field fld = app.ThisDocument.Fields.Add(rng, ref fieldType, ref fieldText,
ref preserveFormatting);
The error is:
System.Runtime.InteropServices.COMException occurred
HelpLink="C:\\Program Files\\Microsoft
Office\\Office12\\1033\\WDMAIN11.CHM#37373"
Message="This command is not available."
Source="Microsoft Word"
ErrorCode=-2146823683
StackTrace:
at Microsoft.Office.Interop.Word.Fields.Add(Range Range, Object&
Type, Object& Text, Object& PreserveFormatting)
at net.windward.autotag.word.WordDocument.WriteTag(TagLocation tag)
in
C:\src\kahuna\AutoTag\AutoTag2007\net\windward\autotag\word\WordDocument.cs:line 692
Any idea?
--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com
Cubicle Wars - http://www.windwardreports.com/film.htm
This happens only if I try to add a field outside a table at the end of a
row (not in the cell, but outside the table after row 0 of a 2x3 table.
The code is:
object fieldType = WdFieldType.wdFieldAutoTextList;
object fieldText = "\"" + "<:forEach>" + "\"" + " \\t \"" +
"</wr:forEach>".Replace("\"", "\\\"") + "\"";
object preserveFormatting = false;
// note rng.Start = rng.End = 3 - get it from Selection
Field fld = app.ThisDocument.Fields.Add(rng, ref fieldType, ref fieldText,
ref preserveFormatting);
The error is:
System.Runtime.InteropServices.COMException occurred
HelpLink="C:\\Program Files\\Microsoft
Office\\Office12\\1033\\WDMAIN11.CHM#37373"
Message="This command is not available."
Source="Microsoft Word"
ErrorCode=-2146823683
StackTrace:
at Microsoft.Office.Interop.Word.Fields.Add(Range Range, Object&
Type, Object& Text, Object& PreserveFormatting)
at net.windward.autotag.word.WordDocument.WriteTag(TagLocation tag)
in
C:\src\kahuna\AutoTag\AutoTag2007\net\windward\autotag\word\WordDocument.cs:line 692
Any idea?
--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com
Cubicle Wars - http://www.windwardreports.com/film.htm