Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-18-2013, 12:54 PM
Baldeagle Baldeagle is offline Macro works in Windows XP but not in Windows 7 Windows XP Macro works in Windows XP but not in Windows 7 Office 2007
Advanced Beginner
Macro works in Windows XP but not in Windows 7
 
Join Date: Apr 2012
Posts: 62
Baldeagle is on a distinguished road
Default Macro works in Windows XP but not in Windows 7

I have used a Macro called EmailMergeWithAttachments which was brought to my attention last year by macropod when he referred me to http://word.mvps.org/FAQs/MailMerge/...ttachments.htm which was created by Doug Robbins. This has worked on my computer which runs Windows XP. But when I try to run it on a laptop which is running on Windows 7 it throws up an error at "Dim oOutlookApp As Outlook.Application" - see the first section of the Macro below.



Is there any obvious reason why this Macro won't work on a laptop running Windows 7? Is this a known gremlin when you upgrade? Can anything be done to make it work in Windows 7?

I would appreciate some guidance.

Code:
Sub emailmergewithattachments()
 
Dim Source As Document, Maillist As Document, TempDoc As Document
Dim Datarange As Range
Dim i As Long, j As Long
Dim bStarted As Boolean
Dim oOutlookApp As Outlook.Application
Dim oItem As Outlook.MailItem
Dim mysubject As String, message As String, title As String

Last edited by macropod; 09-30-2013 at 02:15 PM. Reason: Added code tags
Reply With Quote
  #2  
Old 07-19-2013, 12:28 PM
Baldeagle Baldeagle is offline Macro works in Windows XP but not in Windows 7 Windows XP Macro works in Windows XP but not in Windows 7 Office 2007
Advanced Beginner
Macro works in Windows XP but not in Windows 7
 
Join Date: Apr 2012
Posts: 62
Baldeagle is on a distinguished road
Default Clarification

Just by way of clarification - the message that appears is "Compile Error - User Defined Type not Defined".

Does this throw any light on the problem?
Reply With Quote
  #3  
Old 09-29-2013, 09:22 PM
macropod's Avatar
macropod macropod is offline Macro works in Windows XP but not in Windows 7 Windows 7 32bit Macro works in Windows XP but not in Windows 7 Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Have you set a reference to Outlook, via Tools|References?
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #4  
Old 09-30-2013, 03:56 AM
Baldeagle Baldeagle is offline Macro works in Windows XP but not in Windows 7 Windows XP Macro works in Windows XP but not in Windows 7 Office 2007
Advanced Beginner
Macro works in Windows XP but not in Windows 7
 
Join Date: Apr 2012
Posts: 62
Baldeagle is on a distinguished road
Default

Thanks for the suggestion. Unfortunately my colleague is away for a month and I won't be able to check this until he returns - it was his laptop that I had the problem with. The reference for Outlook is ticked on my PC so I will check this when he returns.
Reply With Quote
Reply

Tags
emailmergewithattachments, macro, windows7

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
macro works on windows, not on mac iiiiifffff Word VBA 2 04-03-2013 12:42 PM
Macro works in Windows XP but not in Windows 7 New Windows longee Office 1 11-19-2012 05:56 PM
Macro works in Windows XP but not in Windows 7 Excel 2003 Macro compatibilty with Windows 7 Chayes Excel Programming 1 07-15-2012 09:05 AM
Macro works in Windows XP but not in Windows 7 Why it works but the macro is error in VB? tinfanide Excel Programming 5 12-03-2011 12:53 AM
previewer for Windows 7 Aiken_Bob Outlook 0 05-01-2011 05:24 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:50 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft