QDVWBS.CreateWordDocument Method

NOTE: This member is now obsolete. Use Qdv.UserApi.IEstimateVersion.CreateWordDocument instead.

Creates either Docx, Docm, PDF or XPS documents from the current estimate.
[Obsolete("Use Qdv.UserApi.IEstimateVersion.CreateWordDocument instead.")] 
public int CreateWordDocument( 
string SourceFile
string TargetFile
bool RenderThroughWordAnyway = False, 
string MacroToBeExecuted = "", 
string ErrorMessage = "" 
)
This language is not supported or no code example is available.

Parameters

SourceFile
string

The full path to the source file, either Docx or Docm.

TargetFile
string

The full path to the target file (which mustn't exist). Either Docx, Docm, PDF or XPS.

RenderThroughWordAnyway
bool

Optional. The default value is false. If set to true, then the document is processed through Word even if PDF or XPS is requested. This is useful to use features which are not natively handled by QDV like updating table of contents. It is useful also to render PDF/XPS using Word and use the powerful Word engine for this. But it is significantly slower and Word 2010 or higher must be installed on the machine.

When false, PDF and XPS documents are rendered directly, in a faster way and it doesn't need Word at all. Notice that in this case, pages in the table of contents cannot be updated.

MacroToBeExecuted
string

Optional. The default value is "". You can provide here the name of a macro to be executed under Word after the document is created. Providing a macro name implicitly sets RenderThroughWordAnyway to true.

ErrorMessage
string

Returns a possible error message. Returns an empty string when no error occurs.

Return Value

int

An error number. 0 when no error occurs.

.NET Framework

Supported in: 4.8, 4.7, 4.6, 4.5.2

In this article

Definition