By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
460,044 Members | 1,172 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 460,044 IT Pros & Developers. It's quick & easy.

DDE and COM

P: n/a
My goal is to have a COM component that can launch a PDF document. So in a
project, I have a form, called frmMain, with a textbox called
txtTransmission on it, and I have this subroutine:

Public Sub LaunchAdobeHelp(ByVal strFile As String)
Dim frm As New frmMain
AppActivate Shell("C:\AcroRd32.exe", vbNormalFocus)
frm.txtTransmission.LinkTopic = "acroview|control"
frm.txtTransmission.LinkMode = vbLinkManual
frm.txtTransmission.LinkExecute "[DocOpen(""" & strFile & """)]"
End Sub

If I compile this as a standard EXE, in a module with a Sub Main like:

Public Sub main()
LaunchAdobeHelp "C:\mydoc.pdf"
End Sub

....then Adobe Acrobat will launch, and will open the proper document.
However, if I compile it as an ActiveX Library (in a class module called
"Adobe"), and in another project write:

Public Sub main()
Dim al As New Adobe
al.LaunchAdobeHelp "C:\mydoc.pdf"
Set al = Nothing
End Sub

....Adobe Acrobat will launch, but will NOT open the document. How can I
fix this?
Nov 20 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.