欧美大屁股bbbbxxxx,狼人大香伊蕉国产www亚洲,男ji大巴进入女人的视频小说,男人把ji大巴放进女人免费视频,免费情侣作爱视频

歡迎來到入門教程網(wǎng)!

vb

當(dāng)前位置:主頁 > 軟件編程 > vb >

VB.net讀取Word文檔屬性的方法

來源:本站原創(chuàng)|時(shí)間:2020-01-10|欄目:vb|點(diǎn)擊: 次

復(fù)制代碼 代碼如下:

'對(duì)自定義屬性進(jìn)行讀取
         Dim Properties = SourceDoc.CustomDocumentProperties
            Dim PropertyType As Type = Properties.GetType

        Try
            Dim Authorprop = PropertyType.InvokeMember("Item", Reflection.BindingFlags.Default Or Reflection.BindingFlags.GetProperty, Nothing, Properties, New Object() {"備注"})
            ResultString = Authorprop.GetType.InvokeMember("Value", Reflection.BindingFlags.Default Or Reflection.BindingFlags.GetProperty, Nothing, Authorprop, New Object() {})

        Catch ex As Exception

        End Try
    '寫入 
    Dim Authorprop = PropertyType.InvokeMember("Item", Reflection.BindingFlags.Default Or Reflection.BindingFlags.SetProperty, Nothing, properties, New Object() {"備注", ResultString})

另一種寫法:

復(fù)制代碼 代碼如下:

'增加新屬性
SourceDoc.CustomDocumentProperties.Add(Name := "PropertyName", LinkToContent := False, Type := Microsoft.Office.Core.MsoDocProperties.msoPropertyTypeString, Value := "PropertyValue")

'修改屬性
SourceDoc.CustomDocumentProperties("PropertyName").Value = PropertyValue

'獲取屬性值
PropertyValue =SourceDoc.CustomDocumentProperties("PropertyName").Value

復(fù)制代碼 代碼如下:

'讀取內(nèi)置屬性,以備注為例
 ResultString= SourceDoc.BuiltInDocumentProperties(Microsoft.Office.Interop.Word.WdBuiltInProperty.wdPropertyComments).value

讀取寫入操作后可以通過在Word文檔上右鍵->屬性查看效果,但當(dāng)Word文檔處于打開狀態(tài)時(shí),文檔上右鍵是沒有“自定義”和“摘要”這兩個(gè)Tab的。

上一篇:VBS 強(qiáng)制關(guān)閉Symantec Endpoint Protection的代碼

欄    目:vb

下一篇:用VBS實(shí)現(xiàn)的發(fā)送帶Cookie的HTTP請(qǐng)求的代碼

本文標(biāo)題:VB.net讀取Word文檔屬性的方法

本文地址:http://mengdiqiu.com.cn/a1/vb/7352.html

網(wǎng)頁制作CMS教程網(wǎng)絡(luò)編程軟件編程腳本語言數(shù)據(jù)庫服務(wù)器

如果侵犯了您的權(quán)利,請(qǐng)與我們聯(lián)系,我們將在24小時(shí)內(nèi)進(jìn)行處理、任何非本站因素導(dǎo)致的法律后果,本站均不負(fù)任何責(zé)任。

聯(lián)系QQ:835971066 | 郵箱:835971066#qq.com(#換成@)

Copyright © 2002-2020 腳本教程網(wǎng) 版權(quán)所有