Sending faxes using foxpro and windows 2003sbs

D

David

Dear All

I am having problems with mapi sending faxes with Outlook 2000 sp3, xp and
2003. Early version are ok. I am getting to a point where I think it may be
a security issue. Sending a normal fax is ok, but if I attach a *.tif file
it comes up undeliverable with the message

The Microsoft Fax transport failed to deliver the message to the recipient.
Not all attachments can be rendered.

Here is my code, I have changed the fax number.



objSession = CreateObject("Mapi.Session")
objSession.Logon ()
MESSAGEBOX("CDO version installed is "+trans(objSession.Version))
objMessage = objSession.Outbox.Messages.Add
objMessage.Subject = "Test"
objMessage.Text = "This is a test with an attachment"

objRecipient = objMessage.Recipients.Add
objRecipient.Name = "[FAX:5555555555]"
objRecipient.Type = 1
objRecipient.Resolve ()
objAttachment = objMessage.Attachments.Add()
objAttachment.Position = 0
objAttachment.Type = 1
objAttachment.ReadFromFile("C:\B.TIF")
objAttachment.Source = "C:\B.TIF"
objAttachment.Name = "B.TIF"
objMessage.Send ()
objSession.Logoff

Thank you for any help

David
Anagram Systems Limited
work email: (e-mail address removed)
 
R

Russ Valentine [MVP-Outlook]

You might want to post in one of the programming groups, too. Not sure
you're going to get the programming traffic in here that could help, unless
Ken Slovak happens by.
 
K

Ken Slovak - [MVP - Outlook]

Thanks, Russ, I just happened by <g>

I see a couple of problems. First of all I'm surprised that the CDO
code isn't triggering the security prompts when a recipient is added
to the message and when the .Send method is used. Outlook 2000 SP2 and
later restrict those things from CDO code. And even in Outlook 2003,
where Outlook VBA code is intrinsically trusted, any CDO code or
Outlook automation code that accesses restricted properties and
methods will trigger the security prompts.

Can you (the original poster) send a fax manually using a TIF
attachment? Usually adding an attachment to a fax and having it work
is a matter of a correctly defined Print verb in the properties of
that attachment type. If you can send it manually it should be
sendable using code. There's no special restrictions on sending TIF
attachments in any Outlook version.

Also, that CDO logon bothers me. If Outlook is running it really
should be a piggy-back logon:
objSession.Logon "", "", False, False
If Outlook isn't running the logon used would need some sort of logon
arguments.




Russ Valentine said:
You might want to post in one of the programming groups, too. Not sure
you're going to get the programming traffic in here that could help, unless
Ken Slovak happens by.
--
Russ Valentine
[MVP-Outlook]
David said:
Dear All

I am having problems with mapi sending faxes with Outlook 2000 sp3, xp and
2003. Early version are ok. I am getting to a point where I think
it may
be
a security issue. Sending a normal fax is ok, but if I attach a *.tif file
it comes up undeliverable with the message

The Microsoft Fax transport failed to deliver the message to the recipient.
Not all attachments can be rendered.

Here is my code, I have changed the fax number.



objSession = CreateObject("Mapi.Session")
objSession.Logon ()
MESSAGEBOX("CDO version installed is "+trans(objSession.Version))
objMessage = objSession.Outbox.Messages.Add
objMessage.Subject = "Test"
objMessage.Text = "This is a test with an attachment"

objRecipient = objMessage.Recipients.Add
objRecipient.Name = "[FAX:5555555555]"
objRecipient.Type = 1
objRecipient.Resolve ()
objAttachment = objMessage.Attachments.Add()
objAttachment.Position = 0
objAttachment.Type = 1
objAttachment.ReadFromFile("C:\B.TIF")
objAttachment.Source = "C:\B.TIF"
objAttachment.Name = "B.TIF"
objMessage.Send ()
objSession.Logoff

Thank you for any help

David
Anagram Systems Limited
work email: (e-mail address removed)
 
D

David

Dear Ken

Thank you for your reply. I do use proper logon in the application, my code
is just for testing.

I have tried sending a fax manually and it does the same. Is this a problem
with the program associated with the tif?

Kind regards

David
Programmer
Anagram Systems Limited
 
K

Ken Slovak - [MVP - Outlook]

Yes, in that case it's a problem not with code but with the Print verb
defined for the TIF extension. Open Windows Explorer and select Tools,
Folder Options. Go to the File Types tab. See what if anything is
registered to handle TIF files and see what the Print and PrintTo
verbs are. You might have to create those verbs, you can model the
settings on the settings for those verbs for other types of files.
 
D

David

Dear Ken

Thank you for your help. I added a printto verb into the registry for the
tif extension, using the Microsoft Office Document Imaging and the code
works

David
Anagram Systems Limited
 
D

David

Yes, in that case it's a problem not with code but with the Print verb
defined for the TIF extension. Open Windows Explorer and select Tools,
Folder Options. Go to the File Types tab. See what if anything is
registered to handle TIF files and see what the Print and PrintTo
verbs are. You might have to create those verbs, you can model the
settings on the settings for those verbs for other types of files.


Dear Ken

I have come across another problem perhaps you could help me with. When I
fax, it sends the attachment to the default printer.

Kind regards

David
Anagram Systems Limited
 
K

Ken Slovak - [MVP - Outlook]

Take a look at Russ's answer yesterday in the thread "Re: sending .tif
files as fax directly from outlook 2003" and see if that helps. It
sounds like the same or a related problem.




 
D

David

Take a look at Russ's answer yesterday in the thread "Re: sending .tif
files as fax directly from outlook 2003" and see if that helps. It
sounds like the same or a related problem.


Dear Ken

Thank you again, that does works.

Kind regards

David
Anagram Systems Limited
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top