473,498 Members | 1,557 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1865

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

Similar topics

8
2246
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
3952
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
420
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
12433
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
1301
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
9114
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
6750
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
2990
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
4933
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
2200
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
7126
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
7005
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
7168
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
5465
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,...
0
4595
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3096
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3087
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1424
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
659
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.