Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
645
WordDocumentWriter - pagesize and cultureinfo/language
posted

Hi,

I am creating a word-document using this approach (only a stub of beginning included):

Private Sub CreateWordReport()
Me.UltraStatusBar.Text = ""
Dim docWriter As WordDocumentWriter = Nothing
Try
docWriter = WordDocumentWriter.Create("c:\testfolder\" & CType(Me.JournalYearToolStripTextBox.Text, String) & "-" & _
CType(Me.JournalNoToolStripTextBox.Text, String) & ".docx")
Catch ex As Exception
Select Case ex.HResult
Case -2147024864
Me.UltraStatusBar.Text = "Feil oppstod ved opprettelse av dokumentet. Vennligst lukk evnt. åpne svarbrev på samme sak."
Exit Sub

End Select

End Try


docWriter.StartDocument()
docWriter.DocumentProperties.LatinCulture = "no-bm"

.....................

The code I have written works fine, but there is two things that I struggle with:

1. I am not able to specify that I want the ".docx" to be a "A4"-document instead of a "letter" (which seems to be default).

2. In MS word my default language is "Norwegian - bokmal", but in documents created  this way the language setting is always reverted to english. I have tried to use the following line: 'docWriter.DocumentProperties.LatinCulture = "no-bm"', but this does not help.

Regards

Kai

Parents Reply Children