Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I started up word and opened a file readonly and recorded a macro when I did it.
I got this bit of code: Documents.Open FileName:="Doc2.doc", ConfirmConversions:=False, ReadOnly:= _ True, AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:="" _ , Revert:=False, WritePasswordDocument:="", WritePasswordTemplate:="", _ Format:=wdOpenFormatAuto So I bet this would work for you: WD.Documents.Open "G:\CONTRACT\Contract Terms\macro\" _ & "macro Jun08_04 Warranty&Maintenance Ts&Cs.C.3 Jun2004 FINAL.doc", _ readonly:=true (well, if I got the spacing correct in your filename!) ======== I've turned off MSWord's printing in the background. It may make it easier for your process, too: Inside MSWord: Tools|Options|Print tab|Uncheck background printing. Brad wrote: Sharad, I have fixed the problem. I moved the Quit Document towards the end, it seemed like it was exiting the doc before the printing could finish. However, I am running into one more problem. When the macro opens the word doc, it is now asking me to select if I want read only and 2 other options. Is there any code that I can enter that will automatically select read only? Thanks. "Sharad" wrote: Hi Brad, 1. Is the path of the word document correct? The last folder name appears to be too long. 2. If it is correct then then just above ' Sheets ("Letter").Select ', add ' On Error GoTo 0 '. Then run the code. It will give error message. Click on Debug and find out which line is causing the error. Post that line. Sharad *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! -- Dave Peterson |