Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA References problem...please help!!!!!!!1

Status
Not open for further replies.

sirkenj

Technical User
Apr 30, 2002
52
US
Hello all, I have a database I am attempting to use to send faxes via WinFax Pro. I'm trying to use DDE to send fax number / etc. to WinFax. I can make the below code work successfully in Visual Basic, but not in VBA, and am guessing it has something to do with a reference loaded in VB, but not in VBA. How do I get the following code to work in VBA? I get the error "method or data member not found" on the first *.LinkTopic line. None of the *.Link* options are available in VBA, but are in VB...any thoughts? Will LinkPoke even work from Access? I'm using Access 2k / WinFax Pro 10.0.2 / Win XP Pro if it matters....

Thanks in advance....

Private Sub Command7_Click()
FAXNumber$ = "555-1212"

SendTime$ = "06:00:00"

SendDate$ = "12/25/96"

FAXName$ = "Benjamin Smith"

Company$ = "Data Processing Services"

'Subject$ = "Joy of Faxing"

Keyword$ = "fax, joy"

BillingCode$ = "5905-001-xx"

Mode$ = "Fax"

CoverPage$ = "C:\Program Files\Norton SystemWorks\WinFax\COVER\ACCID.CVP"

CoverText$ = "Do enjoy this seasonal message."

'Attachment$ = "C:\Program Files\Norton SystemWorks\WinFax\COVER\ACCID.CVP"

'This is the start of the DDE to WinFax.

'Create the link and disable

'automatic reception in WinFax.

Text5.LinkTopic = "FAXMNG32|CONTROL"

Text5.LinkMode = 2

Text5.LinkTimeout = -1

Text5.LinkExecute "GoIdle"

Text5.LinkMode = 0

'Create a new link with the TRANSMIT topic.

Text5.LinkTopic = "FAXMNG32|TRANSMIT"

Text5.LinkMode = 2

Text5.LinkTimeout = -1

Text5.LinkItem = "sendfax"

'Start DDEPokes to control WinFax.

recip$ = "recipient(" & Chr$(34) & FAXNumber$ & Chr$(34) & "," & Chr$(34) & SendTime$ & Chr$(34) & "," & Chr$(34) & SendDate$ & Chr$(34) & ","

recip$ = recip$ & Chr$(34) & FAXName$ & Chr$(34) & "," & Chr$(34) & Company$ & Chr$(34) & "," & Chr$(34) & Subject$ & Chr$(34) & ","

recip$ = recip$ & Chr$(34) & Keyword$ & Chr$(34) & "," & Chr$(34) & BillingCode$ & Chr$(34) & "," & Chr$(34) & Mode$ & Chr$(34) & ")"

Text5.Caption = recip$

Text5.LinkPoke

'setcoverpage

Text5.Caption = "setcoverpage(" & Chr$(34) & CoverPage$ & Chr$(34) & ")"

Text5.LinkPoke

'fillcoverpage

Text5.Caption = "fillcoverpage(" & Chr$(34) & CoverText$ & Chr$(34) & ")"

Text5.LinkPoke

'attach

'Label1.Caption = "attach(" & Chr$(34) & Attachment$ & Chr$(34) & ")"

'Label1.LinkPoke

'showsendscreen

Text5.Caption = "showsendscreen(""1"")"

Text5.LinkPoke

'resolution

Text5.Caption = "resolution(""HIGH"")"

Text5.LinkPoke

'The SendfaxUI parameter is used only

'when a fax-ready cover page and/or

'attachments are included and you do

'not need to print to the WinFax printer

'driver.

Text5.Caption = "SendfaxUI"

Text5.LinkPoke

'Send the fax.

Text5.LinkTopic = "FAXMNG32|CONTROL"

Text5.LinkMode = 2

Text5.LinkTimeout = -1

Text5.LinkExecute "GoActive"

'Close the link between the applications.

Text5.LinkMode = 0
End Sub
 
in the VBA Editor Window have you added the requisite check mark next to the WinFax .dll or .ocx?

This should be under "Tools" then "References"

Also, are you declaring the WinFax object properly in VBA?
 
There is no WinFax .dll or .ocx, it is using .LinkPoke, which is not available in VBScript / VBA, what I am trying to figure out, is if there is a way with a copy of Visual Studio 6 to call the LinkPoke function from within Access (or VBA).
 
you should probably go to the MSKB for this...

Also, I don't know whether you fulfill the requirement or not, but this is lifted from MS.

"NOTE: Microsoft Access does not support the LinkPoke method for any object other than a SQL Topic. For instance, you cannot LinkPoke data into a Microsoft Access table or form."
 
I knew I couldn't call linkpoke from access VBA, but was hoping for some way to call a VB function from within access that would initiate the DDE conversation...I suppose I'll have to get the winfax software development kit to do this...I know I can do it using OLE there. Thanks for your help though....
 
you may still be able to call some VB libraries, but I'm not at all sure about that. Wish I could've been more help.
Best of luck!
-Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top