The 1C:Enterprise developers forum

#1
People who like this: 0 Yes / 0 No
Just came
Rating: 0
Joined: Apr 28, 2014
Company: Long Quân

Hi 1C developers.

I want to print a document using ActiveDocument template.
In the template, there are some data (ex Customer name, phone), and checkbox (ex Gender).
I'm having searched the forum and wiki but have not found any instruction.

Can you help me some instruction to do this:

Code
PrintDoc = Documents.MyDoc.GetTemplate("DocPrint");

ComObject = PrintDoc .Get();

WordDocument = ComObject.Application.Documents(1);

WordDocument.Activate();
//FillData(WordDocument); // fill the data (customer information), fill the checkbox...

// How show the document for printing?

Thank you.

 
#2
People who like this: 0 Yes / 0 No
Timofey Bugaevsky
Guest

Joined:
Company:

Hello, Cường Nguyễn Cao!

Welcome to 1C:Developer Network.

For an example of printing using Microsoft Word, please see Print forms templates list in Administration section of 1C:Small Business.

 
#3
People who like this: 0 Yes / 0 No
Just came
Rating: 1
Joined: Jan 14, 2013
Company:

Hi Cuonng!
If you want to create Template on Document and print it. You can do it follow step:

Code
//Define Spread sheet
Spreadsheet = New SpreadsheetDocument;
//Get Template that you create Templates of Obj Docucment
Template = Documents.DocName.GetTemplate("Temp"); 
//Get Area that you create on Template
AreaContents = Template.GetArea("Contents");
//Fill value into parameter that you define on AreaContents            
AreaContents .Parameters.Phone =  "0123456789";
//Put AreaContents on Spreadsheet                  
Spreadsheet.Put(AreaContents );      
Spreadsheet.Show();
//Spreadsheet.ReadOnly = True;
Spreadsheet.PageOrientation   = PageOrientation.Portrait;
Spreadsheet.FitToPage = True;
Spreadsheet.PageSize = "A4"

 
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)