LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Printing labels from CVI using ActiveX and WORD

I'd like to print labels from CVI. I managed to create the label type I need
in WORD. Now I want to use that in CVI. The following macro describes exactly
what I want. Maybe someone can translate this to CVI, please ???


Sub Macro2()
'
' Macro2 Macro
' Macro recorded 17-02-00 by IT-Systems
'
Documents.Add Template:= _
"C:\Program Files\Microsoft Office\Templates\Normal.dot", NewTemplate:=
_
False
Application.MailingLabel.DefaultPrintBarCode = False
Application.MailingLabel.CreateNewDocument Name:="10.63230", Address:=""
_
, AutoText:="ToolsCreateLabels1", ExtractAddress:=False
End Sub
0 Kudos
Message 1 of 3
(3,174 Views)
"Han Stehmann" wrote:
>>I'd like to print labels from CVI. I managed to create the label type I
need>in WORD. Now I want to use that in CVI. The following macro describes
exactly>what I want. Maybe someone can translate this to CVI, please ???>>>Sub
Macro2()>'>' Macro2 Macro>' Macro recorded 17-02-00 by IT-Systems>'> Documents.Add
Template:= _> "C:\Program Files\Microsoft Office\Templates\Normal.dot",
NewTemplate:=>_> False> Application.MailingLabel.DefaultPrintBarCode
= False> Application.MailingLabel.CreateNewDocument Name:="10.63230",
Address:="">_> , AutoText:="ToolsCreateLabels1", ExtractAddress:=False>End
Sub>
0 Kudos
Message 2 of 3
(3,174 Views)
We do not have an example that will do *exactly* what you need, but you should
find an ActiveX example program, either in the CVI samples folder or on the
Example Programs Database, that illustrates how to print a document in Word.
The function you will need to call that actually invokes the print method
is Word_DocumentPrintOutOld. It's defined in word2000.h; the prototype,
in case you were curious is:

HRESULT CVIFUNC Word_DocumentPrintOutOld (CAObjHandle objectHandle,
ERRORINFO *errorInfo,
VARIANT background, VARIANT append,
VARIANT range, VARIANT outputFileName,
VARIANT from, VARIANT to, VARIANT
item
,
VARIANT copies, VARIANT pages,
VARIANT pageType, VARIANT printToFile,
VARIANT collate,
VARIANT activePrinterMacGX,
VARIANT manualDuplexPrint);

"Han Stehmann" wrote:
>>I'd like to print labels from CVI. I managed to create the label type I
need>in WORD. Now I want to use that in CVI. The following macro describes
exactly>what I want. Maybe someone can translate this to CVI, please ???>>>Sub
Macro2()>'>' Macro2 Macro>' Macro recorded 17-02-00 by IT-Systems>'> Documents.Add
Template:= _> "C:\Program Files\Microsoft Office\Templates\Normal.dot",
NewTemplate:=>_> False> Application.MailingLabel.DefaultPrintBarCode
= False> Application.MailingLabel.CreateNewDocument Name:="10.63230",
Address:="">_> , AutoText:="ToolsCreateLab
els1", ExtractAddress:=False>End
Sub>
0 Kudos
Message 3 of 3
(3,174 Views)