Quantcast
Channel: Hey, Scripting Guy! Blog
Viewing all articles
Browse latest Browse all 3333

PowerTip: Use PowerShell ISE for Standard Enumerations

$
0
0

Summary: Use the Windows PowerShell ISE to use enumeration values.

Hey, Scripting Guy! Question How can I use the Windows PowerShell ISE to use the standard enumeration types to write a
           Word automation script?

Hey, Scripting Guy! Answer Cast the string as a type, and store the returned value in a variable. Each enumeration value
           will be available as a static property. Here is an example:

$HeaderFooterIndex = "microsoft.office.interop.word.WdHeaderFooterIndex" -as [type]

$HeaderFooterIndex::wdHeaderFooterFirstPage


Viewing all articles
Browse latest Browse all 3333

Trending Articles