Avatar of HKFuey
HKFuey
Flag for United Kingdom of Great Britain and Northern Ireland asked on

Access VBA send mail corrupts PDF

I have VBA code that sends PDF documents, if I check the document before sending it looks fine but the recipient receives a corrupted version (Black lines and some pages completely black). BTW we use Exchange 2007

 Set objMessage = CreateObject("CDO.Message")  
    With objMessage
        .Subject = "Test"
        .From = "username@domain.com"
        .To = "username@domain.com"
                 
         objMessage.AddAttachment ("C:\Attach\sample.pdf")
 .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2     .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "xxx.xxx.xxx.xxx"
       .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 2
        .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = "25"
        .Configuration.Fields.Update
       
        .Send
Microsoft AccessExchangeVisual Basic Classic

Avatar of undefined
Last Comment
markmiddlemist

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
markmiddlemist

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
HKFuey

ASKER
FLIPPIN' BRILLIANT!!!!!
IF I COULD GIVE YOU MORE POINTS I WOULD!!!!!!!!!!!!
markmiddlemist

Glad to have spared you the pain we went through on it (trust me, there was lots LOL)
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck