64位Office API声明语句第117讲

VBA语言専攻2024-04-06 18:30:49  90

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

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

【分享成果,随喜正能量】 万物皆有灵,草木亦有心。这世间,万事万物都是有回音的,大至一世界,小至一微粒,你拿出十分的善意,定会收到它以一百分的温柔回馈。。

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

Const SHAREVISTRING = "commdlg_ShareViolation"

Const FILEOKSTRING = "commdlg_FileNameOK"

Const COLOROKSTRING = "commdlg_ColorOK"

Const SETRGBSTRING = "commdlg_SetRGBColor"

Const HELPMSGSTRING = "commdlg_help"

Const FINDMSGSTRING = "commdlg_FindReplace"

Const CD_LBSELNOITEMS = -1

Const CD_LBSELCHANGE = 0

Const CD_LBSELSUB = 1

Const CD_LBSELADD = 2

Type PRINTDLG

lStructSize As Long

hwndOwner As LongPtr

hDevMode As LongPtr

hDevNames As LongPtr

hdc As LongPtr

flags As Long

nFromPage As Integer

nToPage As Integer

nMinPage As Integer

nMaxPage As Integer

nCopies As Integer

hInstance As LongPtr

lCustData As LongPtr

lpfnPrintHook As LongPtr

lpfnSetupHook As LongPtr

lpPrintTemplateName As String

lpSetupTemplateName As String

hPrintTemplate As LongPtr

hSetupTemplate As LongPtr

End Type

Declare PtrSafe Function PrintDlg Lib "comdlg32.dll" Alias "PrintDlgA" (pPrintdlg As PRINTDLG) As Long

Const PD_ALLPAGES = &H0

Const PD_SELECTION = &H1

Const PD_PAGENUMS = &H2

Const PD_NOSELECTION = &H4

Const PD_NOPAGENUMS = &H8

Const PD_COLLATE = &H10

Const PD_PRINTTOFILE = &H20

Const PD_PRINTSETUP = &H40

Const PD_NOWARNING = &H80

Const PD_RETURNDC = &H100

Const PD_RETURNIC = &H200

Const PD_RETURNDEFAULT = &H400

Const PD_SHOWHELP = &H800

Const PD_ENABLEPRINTHOOK = &H1000

Const PD_ENABLESETUPHOOK = &H2000

Const PD_ENABLEPRINTTEMPLATE = &H4000

Const PD_ENABLESETUPTEMPLATE = &H8000&

Const PD_ENABLEPRINTTEMPLATEHANDLE = &H10000

Const PD_ENABLESETUPTEMPLATEHANDLE = &H20000

Const PD_USEDEVMODECOPIES = &H40000

Const PD_USEDEVMODECOPIESANDCOLLATE = &H40000

Const PD_DISABLEPRINTTOFILE = &H80000

Const PD_HIDEPRINTTOFILE = &H100000

Const PD_NONETWORKBUTTON = &H200000

Type DEVNAMES

wDriverOffset As Integer

wDeviceOffset As Integer

wOutputOffset As Integer

wDefault As Integer

End Type

Const DN_DEFAULTPRN = &H1

Declare PtrSafe Function CommDlgExtendedError Lib "comdlg32.dll" Alias "CommDlgExtendedError" As Long

Const WM_PSD_PAGESETUPDLG = (WM_USER)

Const WM_PSD_FULLPAGERECT = (WM_USER + 1)

Const WM_PSD_MINMARGINRECT = (WM_USER + 2)

Const WM_PSD_MARGINRECT = (WM_USER + 3)

Const WM_PSD_GREEKTEXTRECT = (WM_USER + 4)

Const WM_PSD_ENVSTAMPRECT = (WM_USER + 5)

Const WM_PSD_YAFULLPAGERECT = (WM_USER + 6)

Type PAGESETUPDLG

lStructSize As Long

hwndOwner As LongPtr

hDevMode As LongPtr

hDevNames As LongPtr

flags As Long

ptPaperSize As POINTAPI

rtMinMargin As RECT

rtMargin As RECT

hInstance As LongPtr

lCustData As LongPtr

lpfnPageSetupHook As LongPtr

lpfnPagePaintHook As LongPtr

lpPageSetupTemplateName As String

hPageSetupTemplate As LongPtr

End Type

Declare PtrSafe Function PageSetupDlg Lib "comdlg32.dll" Alias "PageSetupDlgA" (pPagesetupdlg As PAGESETUPDLG) As Long

Const PSD_DEFAULTMINMARGINS = &H0 ' default (printer's)

Const PSD_INWININIINTLMEASURE = &H0 ' 1st of 4 possible

Const PSD_MINMARGINS = &H1 ' use caller's

Const PSD_MARGINS = &H2 ' use caller's

Const PSD_INTHOUSANDTHSOFINCHES = &H4 ' 2nd of 4 possible

Const PSD_INHUNDREDTHSOFMILLIMETERS = &H8 ' 3rd of 4 possible

Const PSD_DISABLEMARGINS = &H10

Const PSD_DISABLEPRINTER = &H20

Const PSD_NOWARNING = &H80 ' must be same as PD_*

Const PSD_DISABLEORIENTATION = &H100

Const PSD_RETURNDEFAULT = &H400 ' must be same as PD_*

Const PSD_DISABLEPAPER = &H200

Const PSD_SHOWHELP = &H800 ' must be same as PD_*

Const PSD_ENABLEPAGESETUPHOOK = &H2000 ' must be same as PD_*

Const PSD_ENABLEPAGESETUPTEMPLATE = &H8000& ' must be same as PD_*

Const PSD_ENABLEPAGESETUPTEMPLATEHANDLE = &H20000 ' must be same as PD_*

Const PSD_ENABLEPAGEPAINTHOOK = &H40000

Const PSD_DISABLEPAGEPAINTING = &H80000

Declare PtrSafe Function DdeInitialize Lib "user32" Alias "DdeInitializeA" (pidInst As Long, ByVal pfnCallback As LongPtr, ByVal afCmd As Long, ByVal ulRes As Long) As Long

Declare PtrSafe Function SetServiceBits Lib "advapi32" Alias "SetServiceBits" (ByVal hServiceStatus As LongPtr, ByVal dwServiceBits As Long, ByVal bSetBitsOn As Long, ByVal bUpdateImmediately As Long) As Long

Declare PtrSafe Function CopyLZFile Lib "lz32" Alias "CopyLZFile" (ByVal n1 As Long, ByVal n2 As Long) As Long

Declare PtrSafe Function LZStart Lib "lz32" Alias "LZStart" As Long

Declare PtrSafe Sub LZDone Lib "lz32" Alias "LZDone"

Declare PtrSafe Function mciGetYieldProc Lib "winmm" Alias "mciGetYieldProc" (ByVal mciId As Long, pdwYieldData As Long) As LongPtr

Declare PtrSafe Function mciSetYieldProc Lib "winmm" Alias "mciSetYieldProc" (ByVal mciId As Long, ByVal fpYieldProc As LongPtr, ByVal dwYieldData As Long) As Long

Declare PtrSafe Function midiOutGetNumDevs Lib "winmm" Alias "midiOutGetNumDevs" As Long

Declare PtrSafe Function mmioInstallIOProcA Lib "winmm" Alias "mmioInstallIOProcA" (ByVal fccIOProc As Long, ByVal pIOProc As LongPtr, ByVal dwFlags As Long) As LongPtr

Declare PtrSafe Function CommandLineToArgv Lib "shell32" Alias "CommandLineToArgvW" (ByVal lpCmdLine As String, pNumArgs As Long) As LongPtr

Declare PtrSafe Function IsTextUnicode Lib "advapi32" Alias "IsTextUnicode" (lpBuffer As Any, ByVal cb As Long, lpi As Long) As Long

Declare PtrSafe Function NotifyChangeEventLog Lib "advapi32" Alias "NotifyChangeEventLog" (ByVal hEventLog As LongPtr, ByVal hEvent As LongPtr) As Long

Declare PtrSafe Function SetThreadToken Lib "advapi32" Alias "SetThreadToken" (Thread As LongPtr, ByVal Token As LongPtr) As Long

Type COMMCONFIG

dwSize As Long

wVersion As Integer

wReserved As Integer

dcbx As DCB

dwProviderSubType As Long

dwProviderOffset As Long

dwProviderSize As Long

wcProviderData As Integer

End Type

Declare PtrSafe Function CommConfigDialog Lib "kernel32" Alias "CommConfigDialogA" (ByVal lpszName As String, ByVal hWnd As LongPtr, lpCC As COMMCONFIG) As Long

Declare PtrSafe Function CreateIoCompletionPort Lib "kernel32" Alias "CreateIoCompletionPort" (ByVal FileHandle As LongPtr, ByVal ExistingCompletionPort As LongPtr, ByVal CompletionKey As LongPtr, ByVal NumberOfConcurrentThreads As Long) As LongPtr

Declare PtrSafe Function DisableThreadLibraryCalls Lib "kernel32" Alias "DisableThreadLibraryCalls" (ByVal hLibModule As LongPtr) As Long

Declare PtrSafe Function EnumResourceLanguages Lib "kernel32" Alias "EnumResourceLanguagesA" (ByVal hModule As LongPtr, ByVal lpType As String, ByVal lpName As String, ByVal lpEnumFunc As LongPtr, ByVal lParam As LongPtr) As Long

Declare PtrSafe Function EnumResourceNames Lib "kernel32" Alias "EnumResourceNamesA" (ByVal hModule As LongPtr, ByVal lpType As String, ByVal lpEnumFunc As LongPtr, ByVal lParam As LongPtr) As Long

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

转载此文是出于传递更多信息目的。若来源标注错误或侵犯了您的合法权益,请与本站联系,我们将及时更正、删除、谢谢。
https://www.414w.com/read/132239.html
0
随机主题
#墨西哥一场总统竞选活动舞台倒塌,已致5人死亡,约50人受伤 #事故 #意外雷曼光电4天翻倍, 金瑞矿业有望七连板! 5月22日复盘及翌日计划单车月销3万台, 如今面临困境, 雪佛兰探界者plus能否挽回局面?福特EVOS命名为蒙迪欧运动版, 官图发布, 搭载2.0T混动系统眉山仁寿: 夏日好风景, 公园美名城抹不去的记忆和乡愁 四十余年镜头记录夏收的点点滴滴石家班硬核实力“拒绝锁喉”不信你试试?平安警色丨江苏常熟公安: 多措并举护校安园, 织密未成年人保护网亳州市开展电动自行车夜查行动原神为救流水, 动画攻势来了, 调香师和5.0纳塔希巴拉克建模首爆演训随时可能变实战!东部战区突然行动,毫无征兆却已包围台岛?「王阳明」——文成贤圣王阳明,千载光辉照后人#致每一个热爱生活的你卷价格, 卷新老车主权益, 纯电SUV铂智4X起步价14.98万元苹果手机尾插口不好用怎么办?你先别急着换,看完视频再打算!宇通客车向希腊出口250辆电动公交车, 首批已投入运营都市车界|售价百万! 鸿蒙智行新品牌即将推出Steam账号无法通过遗产继承, 赛博遗产计划破灭森林狼大战独行侠! 李凯尔1分钟砍7分 唐斯打铁 麦克丹尼尔斯爆发暑期中美航线增至每周92班! 机票怎么买便宜?两位老板组团买凯雷德V, 落地400万, 黑白双煞, 暴力美学淋漓尽致俩胳膊都断了,右胳膊甚至断过三次!这样的人也能打NBA?
最新回复(0)