|
-
Aug 21st, 2008, 11:35 AM
#1
Thread Starter
New Member
[RESOLVED] Fax events in VBA
Hi,
I've a problem to work with Fax events in VBA. I want to run a procedure when the 'OnOutgoingMessageAdded' event is triggered. The code is following:
Option Explicit
Dim WithEvents oFS As FAXCOMEXLib.FaxServer
Private Sub Application_Startup()
Set oFS = New FAXCOMEXLib.FaxServer
End Sub
Sub oFS_OnOutgoingMessageAdded(Fserver As FAXCOMEXLib.FaxServer, MsgId As String)
' the event handler
End Sub
and the error I get in the last procedure definition is:
Procedure declaration does not match description of event or procedure having same name
I appreciate any help.
-
Aug 21st, 2008, 12:10 PM
#2
Re: Fax events in VBA
Welcome to the forums. 
Typically that error message means you have to procedures (Subs or Functions or whatever) with the exact same name and VB does not know how to deal with that.
-
Aug 21st, 2008, 01:46 PM
#3
Thread Starter
New Member
Re: Fax events in VBA
Hi,
Thanks for your time.
The issue is that the Sub oFS_OnOutgoingMessageAdded() is not duplicated anywhere else in my code. It's unique. As soon as I rename it, the error disappears. It seems that when I instantiate the FaxServer object, this sub conflicts with something. If I rename this sub, then the event does not trigger. Does anybody has a better idea to use this event?
Thanks.
-
Aug 21st, 2008, 09:50 PM
#4
Re: Fax events in VBA
did you create the sub?
the sub is an event of fax server and is created automatically when you declare with events even if there is no sub of that name. if you find the drop down box for the code pane where you declare with events you can find the events of the fax server created
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Aug 22nd, 2008, 01:22 PM
#5
Thread Starter
New Member
Re: Fax events in VBA
Hi,
Thanks for all your comments.
I found the final solution here:
http://msdn.microsoft.com/en-us/libr...13(VS.85).aspx
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|