469,352 Members | 2,026 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,352 developers. It's quick & easy.

word programming problem with landcape


Thanks for your suggestion Murray Jack.

I also record macro while doing it manually in word then I edit the
macro to see the required code.

Firstly I am creating a blank page. Secondly I go to second page then I
changing page properties manually and I set orientation landscape by
"this point forward".So My first page was portrait and my second page
was landscape.This is what I want to get.

But I can not do this in asp. I can not use "this point forward"
option. So I always make all document landscape.
I think you are a professional about macro programming.Could you tell
me how can I use "this point forward" option while setting orientation
as landscape in asp.

Thanks in advance

Best Regards

Metin
Here is the code which word macro produces:

Documents.Add Template:="Normal", NewTemplate:=False,
DocumentType:=0
Selection.InsertBreak Type:=wdPageBreak
ActiveDocument.Range(Start:=Selection.Start, End:=Selection.Start).
_
InsertBreak Type:=wdSectionBreakNextPage
Selection.Start = Selection.Start + 1
With ActiveDocument.Range(Start:=Selection.Start,
End:=ActiveDocument. _
Content.End).PageSetup
..LineNumbering.Active = False
..Orientation = wdOrientLandscape
..TopMargin = CentimetersToPoints(2.5)
..BottomMargin = CentimetersToPoints(2.5)
..LeftMargin = CentimetersToPoints(2.5)
..RightMargin = CentimetersToPoints(2.5)
..Gutter = CentimetersToPoints(0)
..HeaderDistance = CentimetersToPoints(1.25)
..FooterDistance = CentimetersToPoints(1.25)
..PageWidth = CentimetersToPoints(29.7)
..PageHeight = CentimetersToPoints(21)
..FirstPageTray = wdPrinterDefaultBin
..OtherPagesTray = wdPrinterDefaultBin
..SectionStart = wdSectionNewPage
..OddAndEvenPagesHeaderFooter = False
..DifferentFirstPageHeaderFooter = False
..VerticalAlignment = wdAlignVerticalTop
..SuppressEndnotes = False
..MirrorMargins = False
..TwoPagesOnOne = False
..BookFoldPrinting = False
..BookFoldRevPrinting = False
..BookFoldPrintingSheets = 1
..GutterPos = wdGutterPosLeft
End With
Selection.InsertBreak Type:=wdPageBreak
ActiveDocument.Range(Start:=Selection.Start, End:=Selection.Start).
_
InsertBreak Type:=wdSectionBreakNextPage
Selection.Start = Selection.Start + 1
With ActiveDocument.Range(Start:=Selection.Start,
End:=ActiveDocument. _
Content.End).PageSetup
..LineNumbering.Active = False
..Orientation = wdOrientPortrait
..TopMargin = CentimetersToPoints(2.5)
..BottomMargin = CentimetersToPoints(2.5)
..LeftMargin = CentimetersToPoints(2.5)
..RightMargin = CentimetersToPoints(2.5)
..Gutter = CentimetersToPoints(0)
..HeaderDistance = CentimetersToPoints(1.25)
..FooterDistance = CentimetersToPoints(1.25)
..PageWidth = CentimetersToPoints(21)
..PageHeight = CentimetersToPoints(29.7)
..FirstPageTray = wdPrinterDefaultBin
..OtherPagesTray = wdPrinterDefaultBin
..SectionStart = wdSectionNewPage
..OddAndEvenPagesHeaderFooter = False
..DifferentFirstPageHeaderFooter = False
..VerticalAlignment = wdAlignVerticalTop
..SuppressEndnotes = False
..MirrorMargins = False
..TwoPagesOnOne = False
..BookFoldPrinting = False
..BookFoldRevPrinting = False
..BookFoldPrintingSheets = 1
..GutterPos = wdGutterPosLeft
End With
ActiveDocument.SaveAs FileName:="post.doc",
FileFormat:=wdFormatDocument, _
LockComments:=False, Password:="", AddToRecentFiles:=True,
WritePassword _
:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, _
SaveNativePictureFormat:=False, SaveFormsData:=False,
SaveAsAOCELetter:= _
False

record a macro while doing it manually in word, and then edit the
macro

this will give you the code you need, i do this a lot with word stuff

--
bekil
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------

Jul 22 '05 #1
0 1666

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Paul V Biron | last post: by
1 post views Thread by steven chong | last post: by
8 posts views Thread by Asma | last post: by
1 post views Thread by beanie | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.