Showing posts with label Office 2016. Show all posts
Showing posts with label Office 2016. Show all posts

Wednesday, November 25, 2015

PowerShell & Microsoft Word 2016 : Get the name of Active printer in Word 2016

 

In the previous blog  post, we have see that how can we enable / disable the view of the recent files.

If you have some users, those move from one regional office to other, and if they keep complaining about that their word is too slow and often crash while give print, then it's the issue with printer setup, they may have the  active printer which sits in another office which the user may visit once or often.

My task was to find the active printer in the Microsoft Word. I thought it may be difficult, but rather it was easy, I just need to use the ActivePrinter property of the our $word variable.

$word.ActivePrinter

 

Printer_1

 

Printer_0

That's all, the complete code is :

$word = New-Object -ComObject "Word.Application"

$word.Visible = $true

$word.ActivePrinter

 

Thanks for your time and see you in next blog post.

 

Aman Dhally - Manya Kaur

 

With Regards.
Aman Dhally
If you like, you can follow me on Twitter and Facebook. You can also check my “You Tube channel for PowerShell video tutorials. You can download all of my scripts from “Microsoft TechNet Gallery”.

Monday, November 23, 2015

PowerShell & Microsoft Word 2016 : Opening Clipboard in Word 2016 using PowerShell.

 

In the previous blog posts, we have seem that how can we set the zoom view of a document.

Ok!, this task seems to be tricky one, they ( those wizards), asked me to open Word Clipboard!!!! What!!!!!!

Yes, they asked me if I can open a word clipboard using PowerShell.

At , first , it seems to be a tough job for me , but, you do remember that PowerShell is easy? Yes?

After few hit and tries, I have found it out, it's veryyyyyy simple. Word COM object have a method  by the name of ShowClipboard ( ) .

Simple!!!!!

$word.ShowClipboard()

The complete code is :

 

$word = New-Object -ComObject "Word.Application"

$word.Visible = $true

$word.ShowClipboard()

Aman Dhally - Manya Kaur

Now' let's see, what will be the next challenge may be!

Aman Dhally - Manya Kaur

With Regards.
Aman Dhally
If you like, you can follow me on Twitter and Facebook. You can also check my “You Tube channel for PowerShell video tutorials. You can download all of my scripts from “Microsoft TechNet Gallery”.

Wednesday, November 18, 2015

PowerShell & Microsoft Word 2016 : Opening existing Word Documents using PowerShell.

 

In the previous post, we have seem that how can we can create a new word document using the templates. We have seen how to add and create new documents, but, we hasn't seen, how to open existing documents yet!

To open existing documents, we use the Open( ) , method of the application class.

Let's create a path to my existing word document file :

$myFile = "C:\Users\aman.dhally\Documents\PolyCom-ThreeParty Conefrence.docx"

and then then we have to use the open( ) method. and in parentheses provide the name of the file which we want to be open.

$word.Application.Documents.open($myFile) | Out-Null

That's all :)

The complete code should be look like.

$word = New-Object -ComObject "Word.Application"

$word.Visible = $true

$myFile = "C:\Users\aman.dhally\Documents\PolyCom-ThreeParty Conefrence.docx"

$word.Application.Documents.open($myFile) | Out-Null

try it :)

Aman Dhally - Manya kaur

giphy

 

With Regards.
Aman Dhally
If you like, you can follow me on Twitter and Facebook. You can also check my “You Tube channel for PowerShell video tutorials. You can download all of my scripts from “Microsoft TechNet Gallery”.