Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7739399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T08:30:46+00:00 2026-06-01T08:30:46+00:00

I am doing a bit of Office Automation and when printing a .doc file

  • 0

I am doing a bit of Office Automation and when printing a .doc file using VB.NET Office reference DLLs it causes great CPU load so I want to limit those processes to only use a single virtual core.

I haven’t been able to find anything in Microsoft’s documentation about this and I thought I would ask here as everyone is always so helpful.

This is the code I am using to print

   Dim oWordApp As Word.Application
   Dim oTargetDoc As Word.Document
   oWordApp = New Word.Application

   Select Case SQLdr("Priority")
          Case 1
                 oWordApp.WordBasic.FilePrintSetup(Printer:=printPriority1, DoNotSetAsSysDefault:=1)
          Case 2
                 oWordApp.WordBasic.FilePrintSetup(Printer:=printPriority2, DoNotSetAsSysDefault:=1)
          Case 3
                 oWordApp.WordBasic.FilePrintSetup(Printer:=printPriority3, DoNotSetAsSysDefault:=1)
          Case 4
                 oWordApp.WordBasic.FilePrintSetup(Printer:=printPriority4, DoNotSetAsSysDefault:=1)
          Case 5
                 oWordApp.WordBasic.FilePrintSetup(Printer:=printPriority5, DoNotSetAsSysDefault:=1)
   End Select

   oTargetDoc = oWordApp.Documents.Open(SQLdr("DocumentName") & ".doc")
   oWordApp.PrintOut()
   oWordApp.Documents.Close()
   oWordApp.Quit()
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T08:30:48+00:00Added an answer on June 1, 2026 at 8:30 am

    Here is how you can run this method in a Background thread: http://msdn.microsoft.com/en-us/library/cc221403(v=vs.95).aspx

    ps the most likely reason your seeing high CPU is because of the document size, but you’ll also see high memory because your not cleaning up your objects, eg:

    Marshal.ReleaseComObject(app)
    

    Here’s an article to understand the best practice when it comes to native memory management via managed code: http://jake.ginnivan.net/vsto-com-interop

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've created my first Office Add-in using Visual Studio. It targets the 4.0 .Net
I'm currently doing a bit of experimenting using Autofac-1.4.5.676, autofac contrib and castle DynamicProxy2.
Doing a bit of learning about the Blob type with File access in HTML5
I'm doing a bit of self study on functional languages (currently using Haskell). I
In doing a bit more programming with Firebase today, I found myself wishing for
I'm doing a bit of coding, where I have to write this sort of
I'm doing a bit of Powershell scripting ( for the first time ) to
I was doing a bit research and I came across this comment. I have
How would you go about doing a bit shift in NASM on a register?
My first post here :) I have a summer job doing a bit of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.