HTMLTaskPaneObject 인터페이스
창과 연결된 Microsoft Office InfoPath 2007 양식의 사용자 지정 작업창을 나타냅니다.
네임스페이스: Microsoft.Office.Interop.InfoPath
어셈블리: Microsoft.Office.Interop.InfoPath(microsoft.office.interop.infopath.dll)
구문
<GuidAttribute("096CD548-0786-11D1-95FA-0080C78EE3BB")> _
<CoClassAttribute(GetType(HTMLTaskPaneObjectClass))> _
Public Interface HTMLTaskPaneObject
Inherits HTMLTaskPane
Dim instance As HTMLTaskPaneObject
[GuidAttribute("096CD548-0786-11D1-95FA-0080C78EE3BB")]
[CoClassAttribute(typeof(HTMLTaskPaneObjectClass))]
public interface HTMLTaskPaneObject : HTMLTaskPane
주의
이 형식은 COM 상호 운용성을 위해 관리 코드에 필요한 coclass에 대한 래퍼입니다. 이 coclass에 의해 구현되는 COM 인터페이스의 구성원에 액세스하려면 이 형식을 사용하십시오. 해당 구성원의 설명에 대한 링크를 비롯한 COM 인터페이스에 대한 자세한 내용은 다음을 참고하십시오. HTMLTaskPane.
HTMLTaskPane 개체는 InfoPath 사용자 지정 작업창 작업을 위한 다양한 속성과 메서드를 제공하며 TaskPaneObject 개체의 속성 및 메서드를 제공합니다.
InfoPath 작업창에서 사용할 수 있는 속성과 메서드는 작업 중인 작업창 유형에 따라 결정됩니다. TaskPaneType 속성이 0을 반환하면 해당 작업창은 사용자 지정 작업창이며 HTMLTaskPane 개체에서 제공하는 속성과 메서드를 사용할 수 있습니다. TaskPaneType 속성이 다른 값을 반환하면 작업창은 기본 제공된 작업창이며 TaskPane 개체에서 속성을 제공합니다.
TaskPaneType 속성은 XdTaskPaneType 열거를 사용합니다. 또한 열거된 이 값을 TaskPanesCollection 컬렉션의 Item 속성에 대한 인수로 사용하여 지정된 작업창 형식에 대한 참조를 반환합니다.
![]() |
---|
_XDocumentEventSink2_OnLoadEventHandler 이벤트 중에는 HTMLTaskPane 개체의 속성과 메서드를 호출할 수 없습니다. 이 이벤트가 발생할 때는 보기가 아직 로드되지 않으며 작업창은 보기에 연결되어 있기 때문입니다. |
예제
다음 예제에서는 T:Microsoft.Office.Interop.InfoPath.TaskPanesCollection 컬렉션의 P:Microsoft.Office.Interop.InfoPath.TaskPanes.Item(System.Object) 속성을 사용하여 사용자 지정 작업창을 나타내는 T:Microsoft.Office.Interop.InfoPath.TaskPaneObject 개체에 대한 참조를 가져옵니다. 그런 다음 코드에서 HTMLTaskPane 개체의 Navigate 메서드를 호출하여 HTML 파일을 엽니다.
public void CustomTaskPaneNavigation()
{
// Get a reference to the custom task pane. It is always index [0] in the TaskPanes collection.
HTMLTaskPane oTaskPane = (HTMLTaskPane)thisXDocument.View.Window.TaskPanes[0];
// Navigate based on url specified.
oTaskPane.Navigate("taskpane2.html");
}
다음 예제에서는 TaskPanesCollection 컬렉션의 Item 속성을 사용하여 사용자 지정 작업창을 나타내는 TaskPaneObject 개체에 대한 참조를 가져옵니다. 그런 다음 코드는 TaskPane 개체에서 상속하는 HTMLTaskPane 개체의 HTMLDocument 속성을 사용하여 사용자 지정 작업창의 HTML 코드에 정의된 스트립트 함수를 호출합니다.
// Ensure View has loaded before trying to access the task pane.
if (thisXDocument.View != null)
{
// Get a reference to the custom task pane. It is always the 0-th
// task pane in the TaskPanes collection.
HTMLTaskPane custom = (HTMLTaskPane) thisXDocument.View.Window.TaskPanes[0];
// Ensure that the task pane is completely loaded.
if (custom != null && custom.HTMLDocument.readyState == "complete")
{
mshtml.IHTMLWindow2 window = custom.HTMLDocument.parentWindow;
object[] args = new object[] {"ViewID"};
// call into script through CLR late binding mechanism
window.GetType().InvokeMember(
"SelectView", // late bound method
System.Reflection.BindingFlags.InvokeMethod | // binding flags
System.Reflection.BindingFlags.DeclaredOnly |
System.Reflection.BindingFlags.Public |
System.Reflection.BindingFlags.Instance,
null, // binder object
window, // target object
args);
}
}
참고 항목
참조
HTMLTaskPaneObject 구성원
Microsoft.Office.Interop.InfoPath 네임스페이스