Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Aligning / formatting Pictures in word document using power shell

$
0
0

Hi everybody

I am a system admin my work is to monitor CPU memory load usages in servers

we are now working with Nagios , cacti monitoring tools we need to take Report .

We need to collect the images from site and insert that in word document and we will convert that int pdf
Now we want to do this process using scripts we already wrote bat file to collect the images. but we are inserting that images manually it taking more time just i tried using power shell to insert the images automatically from the path but we are getting one problem we are not able to align that as our own size and format (For Example: we want to paste 2 pic in one row but it is pasting one image in one row,i hereby attached the script 
The script is
$word = New-Object -ComObject Word.Application
$word.Visible = $true
$objDoc = $word.Documents.Add()
$objSelection = $Word.Selection
$objSelection.TypeText("This is the beginning of my text line")
$objShape = $objSelection.InlineShapes.AddPicture("C:\Users\Administrator\Desktop\cacti_wp\wp80-con.png")
$objShape = $objSelection.InlineShapes.AddPicture("C:\Users\Administrator\Desktop\cacti_wp\wp443-con.png")
$objShape = $objSelection.InlineShapes.AddPicture("C:\Users\Administrator\Desktop\cacti_wp\wp80-tra.png")
$objShape = $objSelection.InlineShapes.AddPicture("C:\Users\Administrator\Desktop\cacti_wp\wp443-tra.png")
$objSelection.TypeText("then finishing the line.")
We have to add server names in Bold format and align the size properly this is one of our problem now
Please give any good link or solutions to solve this issue

Viewing all articles
Browse latest Browse all 6937

Latest Images

Trending Articles



Latest Images