Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Variable Imaging and Foxpro Mail Merge

Status
Not open for further replies.

edrossi

Programmer
Jan 24, 2002
42
US
What is the best way to set up a mail/merge in Microsoft Word using a Foxpro file as the data source and have the signature on a letter vary based upon data in the foxpro file?
 

What is the best way to set up a mail/merge in Microsoft Word using a Foxpro file as the data source and have the signature on a letter vary based upon data in the foxpro file?

Is the signature a bitmap? Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first
 
Mike:

The signature is in fact a bitmap image.
 
Here is a portion of code I use to Merge a Word document with a picture (Although it's using a template, the principle is there)
Code:
oWord = CREATEOBJECT("word.application")
    oWord.Documents.OPEN(cWordTemplate)
    loTemplate=oWord.SELECTION
    loTemplate.WholeStory
    loTemplate.COPY
    loDocument=oWord.Documents.ADD()
    SELECT EMP2
    GO TOP
    COUNT TO nCount
    GO TOP
    DO WHILE !EOF()
        x = x + 1
        WITH oWord
            loSelection = oWord.SELECTION
            loSelection.PageSetup.TopMargin = 30
            loSelection.InlineShapes.AddPicture(emp2.pic)
            loSelection.PageSetup.RightMargin=50
            loSelection.PageSetup.LeftMargin=50
            loSelection.typeparagraph
            loSelection.typeparagraph
            loSelection.typeparagraph
            loSelection.PageSetup.BottomMargin = 30
            loSelection.FONT.SIZE = 12
            loSelection.FONT.NAME = "times"
            loSelection.TypeText(ALLTRIM(ldDate))
            loSelection.typeparagraph
            loSelection.typeparagraph
            loSelection.Font.Bold = .T.
            loSelection.TypeText(ALLTRIM(PROPER(EMP2.empfname))+" "+ALLTRIM(PROPER(EMP2.emplName)))
            loSelection.typeparagraph
            loSelection.FONT.SIZE = 10
            loSelection.FONT.NAME = "times"
            loSelection.Font.Bold = .F.
            loSelection.TypeText(ALLTRIM(EMP2.address))

etc......
Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top