64位OfficeAPI声明语句第001讲

VBA语言専攻 2024-09-03 18:43:20

跟我学VBA,我这里专注VBA, 授人以渔。我98年开始,从源码接触VBA已经20余年了,随着年龄的增长,越来越觉得有必要把这项技能传递给需要这项技术的职场人员。希望职场和数据打交道的朋友,都来学习VBA,利用VBA,起码可以提高自己的工作效率,可以有时间多陪陪父母,多陪陪家人,何乐而不为呢?我的教程一共九套,从入门开始一直讲到程序的分发,是学习利用VBA的实用教程。这份API资料是随高级教程赠送的.

这讲我们继续学习64位Office API声明语句第001讲,这些内容是MS的权威资料,看似枯燥,但对于想学习API函数的朋友是非常有用的。

【分享成果,随喜正能量】 如果想要什么,不要外求,只管准备好自己的心念,不断地学习并破除内在的各种认知障碍,万事万物会自动配合你的提升。。

当学员学习到高级阶段,如果引用API,这个资料可以直接查到64位写法。大多数情况下我们是将低版本的程序文件升级到高版本,这时您就不必为如下的错误提示所困扰了:

' -------------------------------------------------------------------------

'

' Win32API_PtrSafe.TXT -- Declare statements for

' Visual Basic for Applications and Microsoft Office 2010

'

' Copyright (C) 2010 Microsoft Corporation.

' All rights reserved.

'

'

' This file contains Declare statements for many functions in the

' Microsoft Windows API for use with Visual Basic for Applications (VBA)

' and Microsoft Office 2010 on 32-bit (x86) and 64-bit (x64) platforms.

'

' The declare statements in this file are not compatible with VB6 or

' previous versions of Microsoft Office. Refer to the Microsoft Windows

' Programmer's Reference for further information on the use of Windows APIs.

'

' You may use, modify, reproduce, and distribute this file (and/or any

' modified version), for use with any of the Microsoft technologies

' described above. THIS FILE IS PROVIDED *AS IS* WITHOUT WARRANTY OF ANY

' KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF

' FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.

' -------------------------------------------------------------------------

' Type definitions for Windows' basic types.

Const ANYSIZE_ARRAY = 1

Type RECT

Left As Long

Top As Long

Right As Long

Bottom As Long

End Type

Type RECTL

Left As Long

Top As Long

Right As Long

Bottom As Long

End Type

Type POINTAPI

x As Long

y As Long

End Type

Type POINTL

x As Long

y As Long

End Type

Type Size

cx As Long

cy As Long

End Type

Type POINTS

x As Integer

y As Integer

End Type

Type MSG

hwnd As LongPtr

message As Long

wParam As LongPtr

lParam As LongPtr

time As Long

pt As POINTAPI

End Type

Const DELETE = &H10000

Const READ_CONTROL = &H20000

Const WRITE_DAC = &H40000

Const WRITE_OWNER = &H80000

Const SYNCHRONIZE = &H100000

Const STANDARD_RIGHTS_READ = (READ_CONTROL)

Const STANDARD_RIGHTS_WRITE = (READ_CONTROL)

Const STANDARD_RIGHTS_EXECUTE = (READ_CONTROL)

Const STANDARD_RIGHTS_REQUIRED = &HF0000

Const STANDARD_RIGHTS_ALL = &H1F0000

Const SPECIFIC_RIGHTS_ALL = &HFFFF&

Type SID_IDENTIFIER_AUTHORITY

Value(0 To 5) As Byte

End Type

Const SID_REVISION = (1) ' Current revision level

Const SID_MAX_SUB_AUTHORITIES = (15)

Const SID_RECOMMENDED_SUB_AUTHORITIES = (1) ' Will change to around 6 in a future release.

Const SidTypeUser = 1

Const SidTypeGroup = 2

Const SidTypeDomain = 3

Const SidTypeAlias = 4

Const SidTypeWellKnownGroup = 5

Const SidTypeDeletedAccount = 6

Const SidTypeInvalid = 7

Const SidTypeUnknown = 8

Type SID_AND_ATTRIBUTES

Sid As LongPtr

Attributes As Long

End Type

' ///////////////////////////////////////////////////////////////////////////

' //

' Universal well-known SIDs //

' //

' Null SID S-1-0-0 //

' World S-1-1-0 //

' Local S-1-2-0 //

' Creator Owner ID S-1-3-0 //

' Creator Group ID S-1-3-1 //

' //

' (Non-unique IDs) S-1-4 //

' //

' ///////////////////////////////////////////////////////////////////////////

Const SECURITY_NULL_RID = &H0

Const SECURITY_WORLD_RID = &H0

Const SECURITY_LOCAL_RID = &H0

Const SECURITY_CREATOR_OWNER_RID = &H0

Const SECURITY_CREATOR_GROUP_RID = &H1

我20多年的VBA实践经验,全部浓缩在下面的各个教程中:

0 阅读:9