View Single Post
 
Old 05-02-2012, 05:48 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,383
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 rwm,

Let's start with the basics:
Quote:
I'm working on a template in word that Prints the document
Please be clear with the terms you're using. In Word parlance, templates and documents are quite different. Are you creating a template, or a document? Your subsequent comments suggest the latter.
Quote:
When you put the document on the network drives the Command Button no longer works even when enabling Macros and such.
Are you sure all your code and userform are all in the file you're using as the template, and not in, say, your 'Normal' template? Does the useform and command button appear?

I also note that you have posted two subs named 'CommandButton1_Click'. You can't have two such subs attached to the one userform. So, how many userforms are we dealing with and on which ones don't the command buttons work? Do you get any error messages? If so, what do they say and what, if any, line is highlighted when you enter the debug mode? Have you added some code to the command button subs to test where they're failing? You could, for example, use something as simple as 'MsgBox "!"' to confirm that the code runs to a certain point.

Re:
Quote:
The problem i ran across there is that when you open from the website it created opens the document as Read-Only and the code no longer Saves or Emails as i wanted it to but does print fine.
Obviously you can't save to a read-only location. This also suggests you're providing a document, not a template.

Re:
Quote:
The reason i created the temp file was because the first line of the document is what i want it saved as and the Subject line of the email and when opened as read-only it just keeps that name and doesnt allow it to change. When the template was opened Word by default wants to save the document as whatever is in the first line of the document which is EXACTLY what i'm looking for.
Unless you're emailing the temp document, this shouldn't be necessary. You can simply retrieve the first paragraph/line's text and use that as the email subject. I imagine Lotus Notes has a parameter for inserting subject names via code, but I'm not familiar with its object model.

You say "it worked perfectly on my machine aslong as you didnt click No in any of the message boxes". Obviously, you'll need to fix that. I note, for example, that you have code that asks the user whether a certain folder exists. Even if the user answers no to that prompt, your code then tries to save the file there. It's bound to fall over in that case. You either need to create the folder without asking the user or, if they choose 'no', asking them where to save the filke to and not proceeding until they've nominated a valid destination, to which the file is then saved.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote