View Single Post
 
Old 01-31-2012, 09:20 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
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

Hi Marrick,

I'm not sure I want to download & install some software I don't need just for testing. I'm also not sure what you mean by "i commented out the session code".

Unless the WinCalendar addin is affecting destination documents as well, you'll probably get acceptable results if you simply comment-out/delete the line:
wdTmp.Documents.Open FileName:=SourceFile, Visible:=False, AddToRecentFiles:=False 'open the source file

It might also be worth mentioning that opening destination documents for processing means a range of other interruptions could occur. For example, the documents might be password-protected, contain macros of their own, make use of addins, or be designed as mailmerge main documents. All of these could generate pop-ups requiring user input. In that regard, using wdTmp.DisplayAlerts = wdAlertsNone could have adverse consequences for some files (eg mailmerge main documents would lose their data connections and be converted to ordinary documents). I suppose one could develop code that simply closes any such problem files and does the style transfer with them in the closed state. The simpler approach would be to tell the users that, if they get such popups, they'll need to respond appropriately (for a mailmerge main document, that would be 'Yes'). The same applies to your problem source document (if you retain the code to open it).
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote