473,396 Members | 2,111 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 1856

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Paul V Biron | last post by:
I'm trying to recreate the layout of a newsletter (produced by an OTS page-layout application) that is basically a 2-column design with a quotation in a box that floats between the 2 columns. ...
1
by: steven chong | last post by:
Hi everyone, Hope the MVPs for Office can help me out here. Programming the word object is new to me. Basically, what i need to do is... 1) Open a template word document. 2) Menu->Insert->File...
2
by: bekil | last post by:
I have a problem with landscape pages in word document. I am creating a word document using asp programming. I want to set n. page as a landscape. But I can not do it. for example I want to...
3
by: Ronny Sigo | last post by:
Hello all, Could anybody give me the correct syntax to set the : line indent, top margin cursor position in Ms Word, with VBA ? Thanks !!! Ronny Sigo .... Here's what I have done so far,...
0
by: Starriol | last post by:
Hello. I'm working on a project with an excel database and need help with the following. This database has some dates that are changed regularly and I need to make an automated system so...
8
by: Asma | last post by:
Dear Sir, I am trying to find a way to open a Word document using C language and read the text of word doc into a variable. (Turbo C on Dos 6.0). Can anyone please tell me which libraries in...
6
by: nagar | last post by:
I need to get the list of Autocorrect entries in word. Is there a way to do it without connecting to Word? Is the list saved somewhere? If I need to connect to Word, how can I detect if it's...
1
by: beanie | last post by:
i am a c programming beginner and i am trying to Create a concordance of Word Count for a text File in c programming but my code isn't working.please can u help me out.here is my code: #include...
2
by: beanie | last post by:
i am a beginer in c programming and i am trying to Create a Concordance of Word Count for a Text File but my code is not working.pls can anyone helpme out.here is my code: #include <stdio.h>...
0
by: athirukk | last post by:
Hi, I am doing Office (Word) programming in .Net with Microsoft.Office.Interop.Word. My C# code highlights the a text range in a Word document with the following snippet. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.