Word

Inhalt

  1. Style Sheet
  2. Printing in foreign currency
  3. Document Variables
    3.1 Examples

1. Style Sheet

What is a style sheet?

A style sheet defines default font types, such as "default", "Header", "Text" etc.. This can be done for example by selecting font, font size, colour, or character spacing. Generating a text, it is then possible to access these types for text formatting. Installing Word, a default style sheet (Normal.dot) gets installed on the computer, which can be adjusted as required. This default style sheet will be assigned to EVERY Word document generated.

Why does ClassiX® have its own style sheet when generating a Word document?

ClassiX® does this to create a uniform appearance of Word documents. Let's say, user A has a defined presetting for font size 12 on his computer and generates an item description. At the same time, user B creates item descriptions with his default font size 8. Printing both item descriptions in an sales order, the font size would permanently change from 8 to 12 and back. The printout appears inconsistent.

Printing can cause another problem. Copying Word documents/their content makes only text and over-defined formats be adopted, but not the style sheet. This can have the effect, that text appears completely different after printing.

Example:

When copying a Word text, only content and additional formats will be adopted. That way, font size and additional specification "bold" will be adopted into document2. The new font though will be "Times New Roman".

This problem will not occur, as long as both Word documents have the same style sheet.

How do I assign a style sheet to a document?

oleObject  - CX_WORD_DOCUMENT
strDotPath - path to style sheet
oleObject Call(GetApplication) -> applicationClip
"CX_WORD_DOT" SystemObject Call(GetEnvironment) -> strDotPath
install style sheet strDotPath applicationClip Call(GetAddIns) Call(Add) Drop
applicationClip Call(Lock)
A flag gets set to make the Word document update automatically with the style sheet. "-1" Integer oleObject Call(PutUpdateStylesOnOpen)
assigning new style sheet strDotPath oleObject Call(PutAttachedTemplate)
The flag gets deactivated again and the style sheet path will be deleted. (see information) "0" Integer oleObject Call(PutUpdateStylesOnOpen)
"" oleObject Call(PutAttachedTemplate)
The Word document gets saved so the format modifications won't get lost.  oleObject Call(CX_Save)

Information for the work with style sheets
After assigning a style sheet to a Word document, the style sheet path should be deleted and the option "automatically update style sheet" deactivated, or else, the style sheet will be accessed every time a word document gets opened. In case the style sheet cannot be accessed with the denoted path, the opening process can take an extremely long time. (Up to 15 seconds, in case the path refers to a network. "//servername/classix/projektname/system/classix.dot")


2. Printing in foreign currency

Printing in a foreign currency works as follows. At first, the transaction to be printed gets wrapped and attached to itself. The same happens with all its sub-items. Prior to printing, the calculation gets started again, just not with the "correct object", but with the wrapper instead. That way, all values that are now recalculated in the new currency will be written in the wrapper. Since when printing, the wrapper will be put into the PlugSpace, too, the new values will be accessed.  

In case the printing happens in a currency without an applied currency table, the table will be generated transiently and applied with AddOverwriteRate via system object.


3. Document variables

 

3.1 Examples

Quotation- / Order Printing

(Head)

Information   Access path Comment
order number   uniqueID  
date   date date written
person in charge Name:
Phone:
Fax:
Email:
personInCharge.Speech(1,0,6)
personInCharge.Access('CX_DESK_PHONE').uniqueID
personInCharge.Fax().uniqueID
personInCharge.Access('CX_E_MAIL').uniqueID
output as first name + surname
address Company name:
Contact person:
Street:
Country:
Post code:
City:
call(Addressee).Name(6)
ordered.personInCharge.Speech(4,0,2)
address.Location()
address.call(CountryText)
address.zipCode
address.city
 
subject
cover letter
footer text
  header.mlComment oder header.mlWordDoc
main.mlComment oder main.mlWordDoc
footer.mlComment oder footer.mlWordDoc
depending on type
delivery text   received.comment  
RG  information   invoiced.comment  
delivery date   delivered.spanDate  
invoicing date   invoiced.spanDate  
shipping date   shipped.spanDate  
net sum   net.value  
sum   total.value  

(Item)

Information   Access path Comment
number   uniqueID
UniqueID()
item number
item number in tree
short name (sales item)   salesItem.mlShortName  
description (sales item)   salemItem.mlDescription  
article text on item   salesItem.item.mlDescription oder salesItem.item.mlWordDoc depends on description type. Je nach Beschreibungsart. (information overwritten in the wrapper)
amount   quantity  
basic price   sales.pricePointer  
gross price   total.pricePer  
net price   netPrice  
net value   net.value  
delivery date   delivered.spanDate  
invoicing date   invoiced.spanDate  
shipping date   shipped.spanDate  
provision date   dispatched.spanDate