Problem sending mail in office 2007 and windows7

Hi,
I have a word template which in autonew makes a mail merge and sends e-mail. 
This have worked fine but now one of my customers have updated to windows7 
and office 2007 and suddenly no mail is sent. I have other customers running 
XP and office 2007 were it works fine. But for this client the question from 
outlook is raised asking if its OK to send mail from an other application but 
no mail is sent.
The code:

Sub Autonew()
Dim SQL_sats As String
Registry_Path = "HKEY_CURRENT_USER\Software\The company\Directories"
Registry_Key = "CustDocs"
         
 Found_Path = System.PrivateProfileString(FileName:="", _
    Section:=Registry_Path, Key:=Registry_Key)
    If Found_Path = "" Then
        Found_Path = "c:\temp\"
    End If
    SQL_sats = "Select * from " & Found_Path & "multistatement.txt" & " 
where ((CUSTOMER_EMAIL IS NOT NULL))"
    On Error GoTo PostPrint
    ActiveDocument.MailMerge.DataSource.QueryString = SQL_sats
    With ActiveDocument
       .AttachedTemplate = ""
       .SaveAs "Statement.doc", wdFormatDocument
        With ActiveDocument.MailMerge
            .Destination = wdSendToEmail
            .MailAsAttachment = True
            .MailAddressFieldName = "CUSTOMER_EMAIL"
            .MailSubject = "Statement"
            .SuppressBlankLines = True
            With .DataSource
                .FirstRecord = wdDefaultFirstRecord
                .LastRecord = wdDefaultLastRecord
            End With
            .Execute Pause:=True
        End With
PostPrint:
On Error GoTo 0
SQL_sats = "Select * from " & Found_Path & "multistatement.txt" & " where 
((CUSTOMER_EMAIL IS NULL ))"
On Error GoTo Comple
ActiveDocument.MailMerge.DataSource.QueryString = SQL_sats
    With ActiveDocument.MailMerge
        .Destination = wdSendToNewDocument
        .SuppressBlankLines = True
        With .DataSource
            .FirstRecord = wdDefaultFirstRecord
            .LastRecord = wdDefaultLastRecord
        End With
        .Execute Pause:=True
    End With
Comple:
End With
End Sub

0
Utf
2/1/2010 2:44:01 PM
word.vba.general 1023 articles. 1 followers. Follow

0 Replies
820 Views

Similar Articles

[PageSpeed] 18

Reply:

Similar Artilces:

Recieve Mail Before Sending
How do I set up Outlook 2003 to recieve mail before sending Set your send/receive group settings to receive and not send. Or are you talking about setting authentication? --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. After searching google.groups.com and finding no answer: Keith <anonymous@discussions.microsoft.com> asked: | How do I set up Outlook 2003 to recieve mail before sending ...

Rollup 2 and Office 2007
I already have Roll Up 1 and the Office 2007 compatibility patch installed. If I now install roll up 2 will I have to reinstall the office 2007 compatibility? yes -- Regards, MS CRM Certified Professional http://microsoftcrm3.blogspot.com Chat with me on MSN / Gmail / Skype : ID Is :.. mscrmexpert@gmail.com "LLoyd" wrote: > I already have Roll Up 1 and the Office 2007 compatibility patch installed. > If I now install roll up 2 will I have to reinstall the office 2007 > compatibility? ...

Excel 2007
When I select cells to copy as a picture in Excel 2007, the resolution is terrible. Text and objects with shadow's are very blotchy when pasting the picture. How do you change the resolution of a 'Copy Picture'? ...

upgrade from mac office to pc?
Can you upgrade from Office 2004 for Mac to Office 2007 for PC for the lower upgrade price? Or do I have to basically start over and buy Office again for $250 - $300 or whatever it is, if I switch from Mac and buy a new PC? (I have Office '04 on my iMac. I'm weighing buying either a new iMac or a new Dell. The cost of buying Office again makes the inferior-but- cheaper Dell almost as expensive as a new Mac, alas.) In article <1191937383.931978.3920@y42g2000hsy.googlegroups.com>, "Charles T. Shay" <cshea2@gmail.com> wrote: > Can you upgrade from Office 2004...

SQL deadlock problem
I am currently having a big issue with sql deadlocking on the PrincipalObjectAccess table. The last few months I have been working on a synchronization process using a Biztalk orchestration. The sync uses the crm webservices to create and update account and contact records in CRM. But now deployment to the production environment gives me some problems. It seems that when trying to update account records (which is one of the first actions in the sync process) the webservice gives me Generic SQL errors and SQL timeouts. After extensive profiling and tracing in SQL I found that there are...

docmd.transfertext problem
Hi, I am using access 97 and tried to import a csv file to the mdb table. I run a code as following: DoCmd.TransferText acImportDelim, "Specification4", "input", DEFAULT_PATH & "online.txt", 1 In online.txt, there is a field which is 10 digit number and I specified it as a double datatype in the specification4. After the import, I found out that the 10 digit number data in the field get empty in the destined table while other fields are all right. Therefore I import manually using specification4 instead of running code. This time the 1...

multiple Domain name delivery problem
hi, I currently have Exchange Server 2003 Build 7638:2 SP2,. We have multiple domain names being delivered to the exchange store. I have nothad any problems, but i currently have one user that is not receiving emails with attachments from one certain "internet" sender to one of her email addresses, but the other address works fine & if they send emails without attachments, everything works fine from either address. I have had the user send them message with attachments to me & the user with the problem & i get the message, but not the other user! I even use message...

Can I send a recurring e-mail automatically each week
I want to send a e-mail with the same verbiage to the same person once a week and make it a recurrence with no end date. Can I set this up once in Outlook so it is scheduled automatically? -- Microsoft Office 2003 Version Students and Teachers Edition Windows Vista Home Premium Thank-you Happy new Year!! Carl R ...

Standalone install of Office 98 Upgrade?
I'm in the process of getting an old Mac up and running on OS 9 for my teenager. I want to install Office 98, but my version, in the box, is Upgrade. I can't find any earlier Office software around here. Does anybody know if I can install the Upgrade version as a standalone, or must I find an earlier version somewhere? Thanks. On 9/13/05 2:11 PM, in article 1126645896.323979.65210@z14g2000cwz.googlegroups.com, "violetcrumble" <sh@centurytel.net> wrote: > I'm in the process of getting an old Mac up and running on OS 9 for my > teenager. I want to install Off...

Mail lMerge
Sorry folks. I asked a question and went to the hospital for a while and the question expired. I have an address list in excel 2007 and am using word 2007. In my address list I have a code column which should allow the selection of addresses to put on labels. I used to have a query section what allows for that but I cannot find query any more. can anyone help me? charles Questions here never expire, though it may become difficult to find the answer. The previous post received one reply, from Doug Robbins, as follows: See the article "Mailmerge Labels with Word ...

How To Copy MS Word mailing labels into Excel
I have a word doc that I want to put into Excel. I want to add some more fields to the names and addresses. Is this simple or do I have to learn how to program? Michael Rodriguez City of Grand Prairie Michael, have you tried to copy and paste the data into excel? -- Paul B Always backup your data before trying something new Please post any response to the newsgroups so others can benefit from it Feedback on answers is always appreciated! Using Excel 2000 & 97 ** remove news from my email address to reply by email ** "Michael Rodriguez" <mrodrigu@gptx.org> wrote in messa...

How can I change 'Normal' Style for Word e-mails to 'Normal (Web)'?
Hi, I'm using Word as my e-mail editor in Outlook 2003 and want to change the default Style for e-mails from 'Normal' to 'Normal (Web)'. The problem is that new e-mails and replies in HTML format use the 'Normal' Microsoft Word 'Style', and this has no gap after paragraphs. The upshot of this is that when sending an e-mail, I have to press return twice to create a gap, but when the recipient views this, their software shows it as four gaps (the extra carriage return I typed + their correctly viewed HTML carriage return after each line). E.g. I type this: ...

Grammar check not working
Hello, I am using Word 2007 and have a problem with grammar and punctuation errors. I deliberately put two spaces between words, do not put space after a comma, write long sentences and finish a sentence without a verb but the green underline never appears. The spell check is functioning properly, no problem with that. In Word Options > Proofing, "Mark grammar errors as you type" is selected. I changed that selection and tried again but it still did not work. I used different languages as default language but no change. I would be grateful if someone could come...

Exchange update problem
I have tried to upgrade exch2k3 sp1 to sp2, but the update fails with "the file pcproxy.dll is in use, and setup cannot identify the app or srvc. setup cannot continue" Any clues/ideas/suggestions? Please. -- ----------------------------------------------------------------------------------------------------------------------- This message has been checked for all known viruses. The information contained in this e-mail and any attachments is confidential and may be the subject of legal, professional or other privilege. It is intended for the named addressee only and may not ...

Crash on 'Send"
My wife's Intel Celeron running ME started having this problem sporadically - now constantly. Outlook 2000 receives OK - everything seems fine until you hit the 'Send' button then Outlook crashes giving an error message that says 'Outlook has caused an error in <unknown> and has to shut down. If the problem persists you may have to restart your computer.' Re-starting however has no effect. I have re-installed Office. Used 'Detect & Repair' under the 'Help' tab, and installed all patches/updates from the Office site. But this error continues, now...

[Exchange 2003] Mail enabled public folder and sender address
I have a Windows 2003 domain with a native mode Exchange 2003 organization; there are some mail enabled public folders. When a user replies to a message in a public folder, the outgoing mail's sender address is the user's one; I want it to be the public folder's one, or at least I'd like the "reply-to" address to be set to the public folder's. How can I accomplish this? Thanks Massimo You would need to grant the user permissions to be able to Send As the public folder. By default, when you reply to a message that is in a PF, the PF is not composing the ...

Strange Access Denied Problem with Windows 7
I got a new computer about six months ago that came with Windows Vista Home Premium 64bit. Before that I had done all of my .NET development either on an XP Pro VM or my former XP Pro computer at home. Shortly after getting my new computer at home, I also got a license for VMWare to be able to test my software on multiple platforms and configurations. I had wrote an application originally in VB.NET that was a simple backup utility. It supports mutiple backup configurations. Any given copnfiguration would define a backup which would be a list of files to backup, a list of folders to ...

How to change font size on formula bar in Excell 2007
I don't find Tools>Options>General (as suggested in other post answers) in Excel 2007. On the Office button there is an Excel Options but it doesn't provide a method of changing font size on the office but. My font is so small I can barely see it. Office button>ExcelOptions>Popular tab>in the "When creating new workbooks" section, choose font and font size -- Kind regards, Niek Otten Microsoft MVP - Excel "jimwillie" <jimwillie@discussions.microsoft.com> wrote in message news:588AAC05-0F52-404E-AA01-128E70E02D0B@microso...

Radar chart in Access 2007 report
Can you add a Radar chart to an access 2207 report? ...

office 2010 and windows 7
word 2010 is hanging (seems on autosave) a great deal, especially with larger (>3MB) files. it hangs the system and I have to do a hard reboot (power down). any idea as to why? system is windows 7 ultimate, office 2010. Right-click My Computer, Disconnect Network Drive. -- Mary Sauer MVP http://msauer.mvps.org/ "KPTools" <support@kptools.com> wrote in message news:0F5ACF22-111A-416A-BECC-8E83543259AE@microsoft.com... > word 2010 is hanging (seems on autosave) a great deal, especially with larger > (>3MB) files. it hangs the system and I have t...

Excel Problem
I have a 23.8 meg excel 2000 spreadsheet set for manual calculation saved to my local hard drive. Every time I try to open it, it takes forver and sometimes never opens but I do not get any error messages, let me just tell you that I am running a P4, 1 GB memory, Office 2K with SP3, and nothing else running when I try to open it. As I said it is set for manual calculation, and it is cleared to not auto calculate when opening or closing. Any idea's as to why this is happening? -- Todd I don't know why you're having this problem but I would like to point something out for w...

SOAP Exception
Hi, In my C# code, I have defined a Map object which is sent as part of a request to a web service, here's an extract of the part of the code: - Map map = new Map(); map.item = new mapItem[4] { new mapItem(), new mapItem(), new mapItem(), new mapItem() }; ................. But when I submit the request containing the Map object, the compiler throws an error with the following message:- org.xml.sax.SAXException: No deserializer for {http://xml.apache.org/ xml-soap}...

Mails not appearing in Inbox although on Server and viewable by colleague
Hi all, I have searched the archives and found a few more or less related topics to my problem, but unfortunately none of them helped. Here's my problem: I know that I recieve several mails at a specific time each day. Those mails are sent to a colleague of mine and myself but only he recieves them. My admins looked on the Exchange Server and all say, that they can definetely see these emails in the server logs and that the server delivered them to the right mailbox. If my colleague looks into my mailbox before(!!) I open Outlook, he sees these mails as unread in my inbox. As soon as I op...

Outlook freezes after sending one email after upgrading 4.0
We just upgraded from 3.0 to 4.0 this weekend. All client machines have had the desktop client upgraded and 2 have the same issue. One is XP with Outlook 2003 and the other is Vista with Outlook 2007. Open opens and the CRM addin initializes correctly. As soon as you compose and send an email, Outlook locks up and you have to kill the process in task manager to close Outlook. I've had the same problem and have tried all I can think of...how did you fix this issue? Thank you. "Sander" wrote: > We just upgraded from 3.0 to 4.0 this weekend. All client machines have...

Exchange 2007 across account search
Does Exchange 2007 has an option to search all users mail for keywords? That all SBS workgroup users can search for messages to/from all other users. Is there any advanced indexing system to speed up search results? Thanks! On Tue, 26 Jan 2010 14:22:12 +0200, "Ronald" <2omikk@gmail.com> wrote: >Does Exchange 2007 has an option to search all users mail for keywords? >That all SBS workgroup users can search for messages to/from all other >users. >Is there any advanced indexing system to speed up search results? > >Thanks! > Bunch of ...