MS Word VBA x32 ->x64 转换,替代 SetParent?

MS Word VBA x32 ->x64 conversion, replacement for SetParent?

我有一个旧的 Word 文档,VBA 内置 x32,我需要更新它以在 x64 中工作。我一直在寻找损坏的 x32 声明并替换它们,但我无法找到以下内容的替代品。

Private Declare Function SetParent Lib "user32.dll" _
(ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long

Ron de Bruin: Excel Automation 是转换 API 来电的救星。

#If VBA7 Then
    Public Declare PtrSafe Function SetParent Lib "user32" Alias "SetParent" (ByVal hWndChild As LongPtr, ByVal hWndNewParent As LongPtr) As LongPtr
#Else
    Private Declare Function SetParent Lib "user32.dll" ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
#End If