-
Word automation and printer spooler document name
I am developping code to print forms with Word automation. A typical print job will have 20 forms to print in sequence. So to improve performance, we start Word only once, add a new document, update the document, print, close the document and proceed with the next document. Since we dont save the document, when we print, the document has a generic name like "Document2".
Trying to change the open document name result in a "Read only" error message.
Is there a way to change the spooler document name. Thanks
Code:
FWordApp.Documents.Add(Template:=FDocumentName,NewTemplate:=False);
FWordApp.Documents.Item(FWordApp.Documents.Count).Activate;
te;
-
Welcome to DevX 
After doing the update, how about doing a SaveAs: and giving each document its on unique name then print and close.
I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
Please use [Code]your code goes in here[/Code] tags when posting code.
Before posting your question, did you look here?
Got a question on Linux? Visit our Linux sister site.
Modifications Required For VB6 Apps To Work On Vista
-
That would work, but our software often runs on a file servers, and worse on Citrix servers. Permissions to write temporary files not easy to get from our customers...so it would be difficult. However, I have to admit that several applications do create temporary files, why not ours. I am not too sure where I can ask Windows for a valid temporary file location.
-
Well, it sounds like your choices are pretty limited.
Either stick with the generic file names you have now, or find a spot to do a SaveAs
Is it a customer that is complaining about the generic Document1, Document2, etc file names?
I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
Please use [Code]your code goes in here[/Code] tags when posting code.
Before posting your question, did you look here?
Got a question on Linux? Visit our Linux sister site.
Modifications Required For VB6 Apps To Work On Vista
-
Its just me who is trying to finish this programming right. I will investiguate the SaveAs. Thanks.
-
I don't see why someone would have a problem giving you some temp space with the proviso that you keep it cleaned up.
I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
Please use [Code]your code goes in here[/Code] tags when posting code.
Before posting your question, did you look here?
Got a question on Linux? Visit our Linux sister site.
Modifications Required For VB6 Apps To Work On Vista
-
Unless it has been blocked by administrators, your application can generally write with confidence to the ApplicationData directory, which you can retrieve with
Code:
system.Environment.GetFolderPath (System.Environment.SpecialFolder.ApplicationData)
You might also try with some of the other folders listed through the SpecialFolder enumeration.
Another avenue would be to use Isolated Storage (look it up in MSDN) which is also usually opened for use.
Jacques Bourgeois
JBFI
http://www3.sympatico.ca/jbfi/homeus.htm
Similar Threads
-
By Stan Brown in forum ASP.NET
Replies: 4
Last Post: 02-13-2010, 08:49 AM
-
By TC in forum VB Classic
Replies: 14
Last Post: 10-04-2000, 03:42 AM
-
By Ryan in forum VB Classic
Replies: 16
Last Post: 05-22-2000, 05:27 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks