Micro Focus QTP (UFT) Forums
CaptureBitmap to Word - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: CaptureBitmap to Word (/Thread-CaptureBitmap-to-Word)



CaptureBitmap to Word - Raj20091 - 09-25-2009

Hello,

How do I write CaptureBitmap value to a word document? I want to be able to keep appending the word document with the screenshots.

Thanks,
Raj


RE: CaptureBitmap to Word - sreekanth chilam - 09-26-2009

Hi ,

I would suggest you to use "Automation Object Model (AOM)" for Word.

We can accomplish many custom requirements using AOM (as your current req.)

Try with below code , you will get it easily Smile

Example:
Code:
Dim wrd
  Const wrdalignpgraphcenter=1
  Set wrd=CreateObject("Word.Application")
  wrd.Visible=True
  Set wrddoc=wrd.Documents.Open ("give ur word doc. path",true)
  wrddoc.Range.Select
  Set wrddocsel=wrd.selection
   Set img= wrddocsel.InlineShapes.AddPicture("required Image path", false,true)
   img.Width=img.Width*2.50
   img.Height=img.Height*2.50
   img.range.paragraphformat.Alignment=wrdalignpgraphcenter
  wrddoc.Save
  wrddoc.close
  wrd.Quit
  Set wrd=nothing
  Set wrddoc=nothing
  Set wrddocsel=nothing
  Set img=nothing



RE: CaptureBitmap to Word - Raj20091 - 09-28-2009

Sreekanth,
That worked like a charm. Thanks!
Where can I get more info on Automation Object Model

-Raj