473,395 Members | 1,694 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,395 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 1854

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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.