DASetInformationA

文档属性、直接访问功能

描述

末尾的 A 表示 ANSI(char)DLL 入口点;ActiveX/COM 接口仅公开 Unicode 形式。其行为与 DASetInformation 相同,字符串参数使用当前 SetAnsiMode 代码页解释

设置文档信息区中的值

可以是 Author 和 Subject 等标准信息,也可以是自定义信息

对于 CreationDate 和 ModDate(修改日期),日期格式应为:D:YYYYMMDDHHmmSSOHH'mm'

where

YYYY 应为年份

MM 应为月份(01-12) DD 应为日期(01-31) HH 应为小时(00-23)

mm 表示分钟(00-59)SS 表示秒(00-59)

O 应使用 +、- 或 Z 字符表示当地时间与世界时(UT)的关系

HH 后接 APOSTROPHE(U+0027)(')应为与 UT 的小时偏移绝对值(00-23)

mm 后跟可选 APOSTROPHE (U+0027)('),应为相对于 UT 的偏移量绝对值,单位为分钟(00-59)

语法

Delphi

Function DLDASetInformationA(InstanceID, FileHandle: Integer; Key, NewValue: PAnsiChar): Integer;

DLL

int DLDASetInformationA(int InstanceID, int FileHandle, const char * Key, const char * NewValue);

参数

FileHandle由 DAOpenFile、DAOpenFileReadOnly 或 DAOpenFromStream 函数返回的句柄
Key标准信息请使用 "Author"、"Title"、"Subject"、"Keywords"、"Creator"、"Producer"、"CreationDate" 或 "ModDate",自定义信息可使用任何其他字符串
NewValue指定键的新值

返回值

0指定的 FileHandle 无效 信息键已成功设置或更新
1