SumatraPDF is a light and fast PDF viewer.
One can control SumatraPDF with DDE commands.
https://www.sumatrapdfreader.org/docs/DDE-Commands.
我要利用BA控制SummatraPDF。
And here is a demo from Microsoft for DDE application.
https://learn.microsoft.com/en-us/office/vba/api/excel.application.ddeinitiate
I tested it in Excel VBA (64bit).
The error message always says Type mismatch
for the line Application.DDEExecute channelNumber, "[FILEPRINT]"
.
I think I need to convert longPtr
type channelNumber
to long
type.
Could you help to point it out how to do this? Thanks.
** 本文件迟交。 外交部
Sub testdde()
Dim channelNumber As LongPtr
channelNumber = Application.DDEInitiate( _
app:="WinWord", _
topic:="C:WINWORDFORMLETR.DOC")
Application.DDEExecute channelNumber, "[FILEPRINT]"
Application.DDETerminate channelNumber
End Sub