مشاركة عبر


WorkbookBase.LinkInfo أسلوب

يحصل على ارتباط التاريخ وتحديث حالة.

مساحة الاسم:  Microsoft.Office.Tools.Excel
التجميع:  Microsoft.Office.Tools.Excel.v4.0.Utilities (في Microsoft.Office.Tools.Excel.v4.0.Utilities.dll)

بناء الجملة

'إقرار
Public Function LinkInfo ( _
    name As String, _
    linkInfoArgument As XlLinkInfo, _
    type As Object, _
    editionRef As Object _
) As Object
public Object LinkInfo(
    string name,
    XlLinkInfo linkInfoArgument,
    Object type,
    Object editionRef
)

المعلمات

  • type
    النوع: System.Object
    أحد XlLinkInfoTypeقيم التي تحدد نوع الارتباط إلى إرجاع معلومات for.
  • editionRef
    النوع: System.Object
    إذا كان الارتباط هو إصدار، th هو تعين معلمة المرجع إصدار كسلسلة في النمط R1C1.EditionRefهو مطلوباً إذا كان هناك هو المزيد publهوher أو المشترك بنفس الاسم في مصنف.

القيمة المُرجعة

النوع: System.Object
القيمة تشير إلى معلومات حول ارتباط.إذا LinkInfoArgumentهو xlUpdateState، هذا الأسلوب بإرجاع 1 إذا كان ارتباط المحدثات تلقائياً، أو إذا كان 2 ارتباط يجب محدثه يدوياً.

ملاحظات

المعلمات الإختيارية

ل معلومات تشغيل معلمات اختيارية، راجع يفتقد المتغير و "المعلمات الاختيارية" في حلول Office.

أمثلة

يستخدم المثال تعليمات برمجية التالي يحصل مجموعة OLE/DDE الارتباطات في مصنف الحالي، وثم يستخدم LinkInfoأسلوب إلى تحديد ما إذا كانت التحديثات كل ارتباط OLE/DDE auإلىmatically يدوياً أو.

Th هو المثال هو لتخصيص المستوى مستند.

Private Sub WorkbookLinkInfo()
    ' Get the collection of DDE/OLE links in the workbook.
    Dim Links As Array = _
        CType(Me.LinkSources(Excel.XlLink.xlOLELinks),  _
        Array)

    ' If there are DDE/OLE links, then display how each link
    ' updates.
    If Links IsNot Nothing Then
        Dim i As Integer
        For i = 1 To Links.Length
            Dim UpdateValue As Integer = Me.LinkInfo(Links(i), _
                Excel.XlLinkInfo.xlUpdateState, _
                Excel.XlLinkInfoType.xlLinkInfoOLELinks)

            If UpdateValue = 1 Then
                MsgBox(Links(i) & " link updates automatically.")
            ElseIf UpdateValue = 2 Then
                MsgBox(Links(i) & " link updates manually.")
            End If
        Next i
    Else
        MsgBox("The workbook contains no DDE/OLE links.")
    End If
End Sub
private void WorkbookLinkInfo()
{
    // Get the collection of DDE/OLE links in the workbook.
    Array links = (Array)this.LinkSources(Excel.XlLink.xlOLELinks);

    // If there are DDE/OLE links, then display how each link
    // updates.
    if (links != null)
    {
        for (int i = 1; i <= links.Length; i++)
        {
            string linkName = (string)links.GetValue(i);
            int updateValue = (int)this.LinkInfo(linkName,
                Excel.XlLinkInfo.xlUpdateState,
                Excel.XlLinkInfoType.xlLinkInfoOLELinks,
                missing);

            if (updateValue == 1)
            {
                MessageBox.Show(linkName + " link updates automatically.");
            }
            else if (updateValue == 2)
            {
                MessageBox.Show(linkName + " link updates manually.");
            }
        }
    }
    else
    {
        MessageBox.Show("The workbook contains no DDE/OLE links.");
    }
}

أمن NET Framework.

راجع أيضًَا

المرجع

WorkbookBase الفئة

WorkbookBase الأعضاء

Microsoft.Office.Tools.Excel مساحة الاسم