DJ143

screen shots in word document

4 posts in this topic

hi all,

I have an issue for saving screenshots. using _ScreenCapture_Capture() I can save a snapshot in a particular location. But is there a way to move that snapshot into a word doc and other snapshots in same document. So that this would be easier for me to consolidate the screesnshots for a particular scenario.

Share this post


Link to post
Share on other sites



Have a look at the _Word_*** functions, including _Word_DocPictureAdd.


Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Share this post


Link to post
Share on other sites

hi,

thanks for your suggestion.  following is the code:

#include <ScreenCapture.au3>
#include <Word.au3>

 _ScreenCapture_Capture(@ScriptDir & "\image.png")

Local $oWord = _Word_Create()

Local $oDoc = _Word_DocOpen($oWord, @ScriptDir & "\Test.doc", Default, Default, False)

Local $oRange = _Word_DocRangeSet($word, -2)

_Word_DocPictureAdd($word, @ScriptDir & "\image.png", Default, Default, $oRange)

 

This open the word doc every time while taking the screenshot. Is there anyway of keeping the word doc in hidden and taking the screenshot?

Share this post


Link to post
Share on other sites

Use _Word_DocAttach to connect to the already open document. If this fails then the document hastn't been opened yet and you need to call _Word_DocOpen.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now