Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

WordBasic Object Commands

Posted on 1997-04-30
4
Medium Priority
?
315 Views
Last Modified: 2012-06-21
I have an object declared as a Word.Basic type.  I send text from my VB app to it and need to print it.  Before I print it, however I need to change the printer orientation to Landscape.  How do I do this?
(ie, if my object name is WordLanguage, I know that the executing WordLanguage.InsertPageBreak inserts a page break, and WordLanguage.Font "Courier" sets the font type to Courier, but what property do i have to access to set (or return) the printer orientation?)
0
Comment
Question by:Loiosh
  • 2
  • 2
4 Comments
 
LVL 7

Expert Comment

by:tward
ID: 1425859
Try:

 WordLanguage.FilePageSetup.Orientation=0 ' Portrait
 WordLanguage.FilePageSetup.Orientation=1 ' Landscape

You can also try:

 WordLanguage.TogglePortrait  

from what I have read TogglePortrait will toggle between Landscape and Portrait...

Hope this helps.
0
 

Author Comment

by:Loiosh
ID: 1425860
I hate to say it, but it doesn't work.  When I try WordLanguage.FilePageSetup.Orientation = 1, I get a run-time error 424 (object required) and while WordLanguage.TogglePortrait , does cause it to change to from one mode to the other -- that doesn't help me if the printer was already in Landscape mode (there doesn't seem to be a way to check the printers original orientation.)
0
 
LVL 7

Accepted Solution

by:
tward earned 100 total points
ID: 1425861
The only way to change to orientation then would be to set it up as a macro and then run the macro from visual basic.
0
 

Author Comment

by:Loiosh
ID: 1425862
Okay -- thanks for the help -- I guess I will try that
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question