New Forum | Previous | Next | (P-PDF) Developers
Topic: Please help: DDE in Visual Basic
Conf: (P-PDF) Developers, Msg: 55717
Date: 5/29/2002 05:14 PM
>I tried this code:
>Private Sub Command1_Click()
> Text1.LinkMode = 0
> Text1.LinkTopic = "acroview|control"
> Text1.LinkItem = "[DocOpen(D:\v000313.pdf)]"
> Text1.LinkMode = 1
> And the sub hangs up on the last line. Gives me a
> RTE 282: "No foreign application responded to a DDE
You have to make sure that the Acrobat viewer is launched prior to running that code. I use the Windows API function "ShellExecute" to open the PDF in Acrobat before running the DDE code. DocOpen can take a long time to work if you don't do this. You should also have a LinkTimeout statement. Try something like:
.LinkMode = 0
.LinkTopic = "acroview|control"
.LinkMode = 2
' Wait five seconds
.LinkTimeout = 5000
' Go to fourth page
.LinkExecute "[DocGoTo(D:\v000313.pdf, 3)]"