LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Need VBA help

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
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 12:33 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"