BOUNTY开始了,但我想在C#中做例子
我需要遵循:
在我的申请中,我有文件.需要一直检查和检出的文件.当我从我的应用程序中检查一个Document时,我需要将自定义属性添加到文件中,这样我以后可以在我签入文档时识别它.
我尝试使用以下代码使用DSOFile中的OleDocumentProperties,但没有成功:
// Adding custom properties to file (Parameters: FileName, custom property name, value, debug: true/false
DocumentProperties.WriteDocumentProperty(filename, "dms_dossiernummer", _dossiernummer.ToString(), false);
DocumentProperties.WriteDocumentProperty(filename, "dms_zaaknaam", ReturnZaaknaam(_dossiernummer), false);
DocumentProperties.WriteDocumentProperty(filename, "dms_verantw_medew", ReturnVerantwMedew(_dossiernummer), false);
DocumentProperties.WriteDocumentProperty(filename, "dms_document_path", path, false);
DocumentProperties.WriteDocumentProperty(filename, "dms_bestandsnaam", bestandsNaam, false);
DocumentProperties.WriteDocumentProperty(filename, "dms_bestands_id", bestandId, false);
DocumentProperties.WriteDocumentProperty(filename, "dms_is_checkedout", "true", false);
DocumentProperties.WriteDocumentProperty(filename, "dms_dossier_map_id", dossierMapId, false);
DocumentProperties.WriteDocumentProperty(filename, "dms_bestand_versie_nummer", Queries.Dms.Selects.GetDocumentVersion(
Convert.ToInt32(bestandId)).ToString(), false);
DocumentProperties.WriteDocumentProperty(filename, "dms_bestands_locatie", path, false);
Run Code Online (Sandbox Code Playgroud)
有没有人知道将自定义文件属性添加到文件的另一种方法?
有没有办法在尝试打开工作簿之前检查工作簿是否受到保护。
这是我的代码,但我不知道方法(如果可能)
Sub MySub()
Dim Wb As Workbook
For i = 14 To Cells(Rows.Count, 1).End(xlUp).Row
'I Would like to check if the workbook is Protected here
Set Wb = GetObject(Cells(i, 4).Value)
Wb.Open
End Sub
Run Code Online (Sandbox Code Playgroud)
注意:此代码中的代码Cells(i,4).Value将等于工作簿路径。
我正试图抓住特定文本文件上传到计算机上的日期.日期不在实际文本文件中,而是必须右键单击,然后转到属性以查看日期.我需要将日期读入变量.
我不知道从哪里开始尝试完成这项工作.
谢谢,
杰西斯莫瑟蒙
请告知如何在打开文件之前检查文件是否为只读。
这是我用来打开文件的代码:
myFileNameDir = "H:\Shaikh_Gaus\scratch\VBA\Book16.xlsx"
Workbooks.Open Filename:=myFileNameDir, UpdateLinks:=0
Set ws1 = Worksheets("Students")
Run Code Online (Sandbox Code Playgroud)