We have some .NET code, and we're attempting to use DDE to open a PDF
document and navigate to a bookmark in it using DDE. .NET doesn't support
DDE, so we hid the DDE behind a COM interface.
It doesn't work; Acrobat Reader starts, but the document isn't opened. I
have verified that the code DOES work, given the same inputs, if pasted
into a plain VB exectuble, and not called through .NET/COM. Why?
My code, trimmed for clarity, follows (frmMain is a blank form with a text
box called txtTransmission):
Public Sub OpenPDF(ByVal strFile As String, ByVal strDest As String)
Dim frm As New frmMain
Dim Q As String: Q = Chr(34) ' Quote character
AppActivate Shell(/*path to acrobat*/, vbNormalFocus)
frm.txtTransmission.LinkTopic = "acroview|control"
frm.txtTransmission.LinkMode = vbLinkManual
frm.txtTransmission.LinkExecute "[DocOpen(" & Q & strFile & Q & ")]" _
& "[DocGoToNameDest(NULL," & Q & strDest & Q & ")]"
End Sub
Thanks,
David
|