Board logo

標題: [發問] 檔案右鍵>內容>詳細資料內資訊問題詢問 [打印本頁]

作者: rouber590324    時間: 2018-9-18 09:07     標題: 檔案右鍵>內容>詳細資料內資訊問題詢問

Dear  all 大大
1.EXCEL檔案按滑鼠 右鍵>內容>詳細資料內>之所有資訊如何使用VBA將資料導到 儲存格內呢???
2.煩不吝賜教   THANKS*10000
作者: rouber590324    時間: 2018-9-18 16:16

DEAR ALL
但是我不知道擁有者的語法, 測試 .Dateowner或 .DateUserName都錯誤

目前我只知道檔案建立日期語法如下:
 Dim FSO As Object, Xa As String, Ax As Integer
    Set FSO = CreateObject("Scripting.FileSystemObject")
    Xa = Sheet1.[D1048576].End(xlUp).Row
    For Ax = 8 To Xa
    If Sheet1.Cells(Ax, 3) <> "" Then
    Sheet1.Cells(Ax, 6) = FSO.GetFile(Sheet1.Cells(Ax, 4)).DateCreated
'    Set FSO = Nothing
    End If
    Next

但是我不知道擁有者的語法, 測試 .Dateowner或 .DateUserName都錯誤
作者: jackyq    時間: 2018-9-18 17:54

debug.Print Environ("username")
debug.Print Environ("computername")
作者: jackyq    時間: 2018-9-19 12:05

本帖最後由 jackyq 於 2018-9-19 12:07 編輯

excel 有欄位可存放作者名

magbox ActiveWorkbook.BuiltinDocumentProperties("Author").Value

'change Author name
ActiveWorkbook.BuiltinDocumentProperties("Author").Value = "rouber590324"

magbox ActiveWorkbook.BuiltinDocumentProperties("Author").Value

其他支援名  https://msdn.microsoft.com/zh-tw/library/microsoft.office.tools.excel.workbook.builtindocumentproperties.aspx

    標題

    Subject

    Author

    Keywords

    註解

    範本

    上次存檔者

    修訂版編號

    應用程式名稱

    列印日期

    建立日期

    存檔時間

    編輯總時間

    頁數

    字數

    字元數

    安全性

    類別

    Format

    Manager

    公司

    位元組數

    行數

    段落數

    投影片數

    附註

    隱藏投影片數

    多媒體資料

    超連結基底

    字元數 (含空白)
作者: jackyq    時間: 2018-9-19 14:07

本帖最後由 jackyq 於 2018-9-19 14:12 編輯

英文版的關鍵字才是正確的
https://msdn.microsoft.com/en-us/library/microsoft.office.tools.excel.workbook.builtindocumentproperties.aspx

' 對照上面就是他的中文意義

Title
Subject
Author
Keywords
Comments
Template
Last author
Revision number
Application name
Last print date
Creation date
Last save time
Total editing time
Number of pages
Number of words
Number of characters
Security
Category
Format
Manager
Company
Number of bytes
Number of lines
Number of paragraphs
Number of slides
Number of notes
Number of hidden Slides
Number of multimedia clips
Hyperlink base
Number of characters (with spaces)
作者: rouber590324    時間: 2018-9-19 14:48

DEAR jackyq  SIR
THANKS*100000000




歡迎光臨 麻辣家族討論版版 (http://forum.twbts.com/)