none
WORD AUTOMATION C++ (VS6.0). How I can overwrite on background picture? RRS feed

  • Question

  • Hello, I use Word Automation in C++ (VS6.0).

    I load a picture (file *.jpg) in my document. This picture is the background.

    How I can write on this picture?

    Thanks for code or links that solve my problem.

    Bye

    Wednesday, June 21, 2017 10:31 AM

All replies

  • Hello,

    To write on a picture, we need to set its wrapping style into "Behind Text".

    Please visit

    InlineShapes.AddPicture Method (Word)

    InlineShape.ConvertToShape Method (Word) 

    WrapFormat.Type Property (Word)

    In VBA, we could use:

    Sub Demo()
    Dim myShape As Shape
    Dim myInlineShape As InlineShape
    Set myInlineShape = Selection.InlineShapes.AddPicture(FileName:="filePath", LinkToFile:=False, SaveWithDocument:=True)
    Set myShape = myInlineShape.ConvertToShape
    myShape.WrapFormat.Type = wdWrapBehind
    Selection.TypeText ("TEST")
    End Sub

    Regards,

    Celeste



    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, June 22, 2017 2:54 AM
    Moderator