M
Mattia Saccotelli
How to unwrap SemiTrust's objects?
An MSDN's tutorial did the following:
private Microsoft.Office.Core.CommandBars UnwrapCommandbarsObject(
Microsoft.Office.Interop.InfoPath.SemiTrust.ObjectWrapper
commandBarsWrapper ) {
Type t = commandBarsWrapper.GetType().BaseType;
Microsoft.Office.Core.CommandBars objCommandBars =
(Microsoft.Office.Core.CommandBars)t.InvokeMember( "InnerObject",
BindingFlags.Public | BindingFlags.NonPublic |
BindingFlags.Instance | BindingFlags.GetProperty,
null, commandBarsWrapper, null);
return objCommandBars;
}
to access the CommandBar. I need to access the thisXDocument.DataObjects
to modify query parameters as in JavaScript. In JS it would be:
strSqlCommand =
XDocument.DataObjects.Item("SalesSummary").QueryAdapter.Command;
strSqlCommand = strSqlCommand.replace(/@Ending_Date='[^']+'/,
"@Ending_Date='" + SqlDateTime(dtEnd) + "'");
How to access the Command property?? It's not there in the C# object!
Ms experts????
thanks!
An MSDN's tutorial did the following:
private Microsoft.Office.Core.CommandBars UnwrapCommandbarsObject(
Microsoft.Office.Interop.InfoPath.SemiTrust.ObjectWrapper
commandBarsWrapper ) {
Type t = commandBarsWrapper.GetType().BaseType;
Microsoft.Office.Core.CommandBars objCommandBars =
(Microsoft.Office.Core.CommandBars)t.InvokeMember( "InnerObject",
BindingFlags.Public | BindingFlags.NonPublic |
BindingFlags.Instance | BindingFlags.GetProperty,
null, commandBarsWrapper, null);
return objCommandBars;
}
to access the CommandBar. I need to access the thisXDocument.DataObjects
to modify query parameters as in JavaScript. In JS it would be:
strSqlCommand =
XDocument.DataObjects.Item("SalesSummary").QueryAdapter.Command;
strSqlCommand = strSqlCommand.replace(/@Ending_Date='[^']+'/,
"@Ending_Date='" + SqlDateTime(dtEnd) + "'");
How to access the Command property?? It's not there in the C# object!
Ms experts????
thanks!