DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

picprint mis-position picture anchors

We use the following VB script to print Report sheets to Word doc. The problem is the pictures keeps anchoring further down (south of the Column break) on each page of the doc. We need to keep the picture consistently anchor at the same position on each page. Any ideas on how to do this?

The problem occurs on the following environment

Windows: 7

DIAdem: 11

MS Word: 2010

 

We believe that this problem does not occur using MS Word 2007.

 

for sheetNum = 1 to graphSheetCount            ' Cycle through all sheets
  PrintFromPage = sheetNum
  PrinttoPage   = sheetNum
  Call GraphSheetNGet(sheetNum)
  Call GraphSheetShow(GraphSheetName)
  Call PicMaxPageCalc
 
  For pageNum=1 to MaxYPage 'Printing all pages of the table
    CurrYPage = pageNum
    Dim myRange
    Const wdPasteMetafilePicture = 3
    'Insert a picture
    'Call  WdEasyTextCenter(Word,"")     'Insert CRLF before picture
    Call PicPrint("WinClip")             'Copy graph device to clip board
    Set myRange = word.ActiveDocument.Range(word.ActiveDocument.Range.End-1, word.ActiveDocument.Range.End)
    myrange.PasteSpecial , , , ,wdPasteMetafilePicture
 
    if pageNum <> MaxYPage then
      call WdPageBreak(Word)
    end if
  next

  if sheetNum <> graphSheetCount then
   call WdPageBreak(Word)
  end if
Next

 

 

 

 

 

 

 

 

 

 

0 Kudos
Message 1 of 3
(5,214 Views)

I tried to post a screenshot for clarification but the posting fails with error "msg cannot exceed 10,000 characters".

0 Kudos
Message 2 of 3
(5,212 Views)

Hi Larry,

 

VBScript and Word are both Microsoft products.  There's is nothing in the metafile paste method that belongs to DIAdem.  This is a question for Microsoft to answer, "How can I get your VBScript language to paste a picture file into your Word program using its ActiveX interface?".

 

If I knew the answer, I'd be happy to tell you, but I don't.,

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 3 of 3
(5,177 Views)