Home > Software engineering >  Column c word page
Column c word page

Time:10-11

C + + word page, shuizhidao, ruhe columns,


Word page columns, c + +, this code is how to write ah
CPageSetup oPageSetup=docx_active. Get_PageSetup ();
//set the direction and margins for the page
OPageSetup. Put_TextColumns ((LPDISPATCH), "2");


In short, how to use the word documents generated by the c + + will be set to horizontal, then column into a 2 column

[11] set the width of the number of columns and column
Here it is important to note that the add function of logic
1 SectionsPtr word_sections=doc - & gt; GetSections ();
2 long num=word_sections - & gt; GetCount ();
3 SectionPtr word_section=word_sections - & gt; The Item (num - 1);
4 PageSetupPtr page_setup=word_section - & gt; GetPageSetup ();
5 TextColumnsPtr text_cols=page_setup & gt; GetTextColumns ();
6 text_cols - & gt; PutEvenlySpaced (0);
7 text_cols - & gt; Add (COleVariant (col_width), COleVariant (0) (long), COleVariant ((long), false));
This is someone else's code, according to the change, I always prompt function does not accept three parameters

CodePudding user response:

Shiduoshaoa put_textcolumns cost?

CodePudding user response:

'Macro3 Macro
'macro in 2016/9/3 by PC recording
'
With ActiveDocument. Styles (wdStyleNormal). The Font
If. NameFarEast=. NameAscii Then
. NameAscii=""
End the If
. NameFarEast=""
End With
With ActiveDocument. PageSetup
. LineNumbering. Active=False
The Orientation=wdOrientPortrait
. TopMargin=CentimetersToPoints (2.54)
. BottomMargin=CentimetersToPoints (2.54)
. LeftMargin=CentimetersToPoints (3.17)
. RightMargin=CentimetersToPoints (3.17)
The Gutter=CentimetersToPoints (0)
. HeaderDistance=CentimetersToPoints (1.5)
. FooterDistance=CentimetersToPoints (1.75)
PageWidth=CentimetersToPoints (21)
PageHeight=CentimetersToPoints (29.7)
. FirstPageTray=wdPrinterDefaultBin
. OtherPagesTray=wdPrinterDefaultBin
. SectionStart=wdSectionNewPage
. OddAndEvenPagesHeaderFooter=False
. DifferentFirstPageHeaderFooter=False
The VerticalAlignment=wdAlignVerticalTop
. SuppressEndnotes=False
. MirrorMargins=False
. TwoPagesOnOne=False
. BookFoldPrinting=False
. BookFoldRevPrinting=False
. BookFoldPrintingSheets=1
. GutterPos=wdGutterPosLeft
. LayoutMode=wdLayoutModeLineGrid
End With
End Sub
Sub Macro2 ()
'
'Macro2 Macro
'macro in 2016/9/8 by PC recording
'
With ActiveDocument. Styles (wdStyleNormal). The Font
If. NameFarEast=. NameAscii Then
. NameAscii=""
End the If
. NameFarEast=""
End With
With ActiveDocument. PageSetup
. LineNumbering. Active=False
The Orientation=wdOrientLandscape
. TopMargin=CentimetersToPoints (3.17)
. BottomMargin=CentimetersToPoints (3.17)
. LeftMargin=CentimetersToPoints (2.54)
. RightMargin=CentimetersToPoints (2.54)
The Gutter=CentimetersToPoints (0)
. HeaderDistance=CentimetersToPoints (1.5)
. FooterDistance=CentimetersToPoints (1.75)
PageWidth=CentimetersToPoints (42)
PageHeight=CentimetersToPoints (29.7)
. FirstPageTray=wdPrinterDefaultBin
. OtherPagesTray=wdPrinterDefaultBin
. SectionStart=wdSectionNewPage
. OddAndEvenPagesHeaderFooter=False
. DifferentFirstPageHeaderFooter=False
The VerticalAlignment=wdAlignVerticalTop
. SuppressEndnotes=False
. MirrorMargins=False
. TwoPagesOnOne=False
. BookFoldPrinting=False
. BookFoldRevPrinting=False
. BookFoldPrintingSheets=1
. GutterPos=wdGutterPosLeft
With the TextColumns
The SetCount NumColumns:=2
. EvenlySpaced=True
End With
. CharsLine=54
. LayoutMode=wdLayoutModeLineGrid
End With
With ActiveDocument. Styles (wdStyleNormal). The Font
If. NameFarEast=. NameAscii Then
. NameAscii=""
End the If
. NameFarEast=""
End With
With ActiveDocument. PageSetup
. LineNumbering. Active=False
The Orientation=wdOrientLandscape
. TopMargin=CentimetersToPoints (3.17)
. BottomMargin=CentimetersToPoints (3.17)
. LeftMargin=CentimetersToPoints (2.54)
. RightMargin=CentimetersToPoints (2.54)
The Gutter=CentimetersToPoints (0)
. HeaderDistance=CentimetersToPoints (1.5)
. FooterDistance=CentimetersToPoints (1.75)
PageWidth=CentimetersToPoints (42)
PageHeight=CentimetersToPoints (29.7)
. FirstPageTray=wdPrinterDefaultBin
. OtherPagesTray=wdPrinterDefaultBin
. SectionStart=wdSectionNewPage
. OddAndEvenPagesHeaderFooter=False
. DifferentFirstPageHeaderFooter=False
The VerticalAlignment=wdAlignVerticalTop
. SuppressEndnotes=False
. MirrorMargins=False
. TwoPagesOnOne=False
. BookFoldPrinting=False
. BookFoldRevPrinting=False
. BookFoldPrintingSheets=1
. GutterPos=wdGutterPosLeft
With the TextColumns
The SetCount NumColumns:=4
. EvenlySpaced=True
End With
. 26 CharsLine=
. LayoutMode=wdLayoutModeLineGrid
End With
End Sub

CodePudding user response:

With the TextColumns
nullnullnullnull
  • Related