Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
SRV
 
Posts: n/a
Default Error in MS Word VBA for pagesetup Dialog

HI,

Please Help me in finding cause for an error in following code in VBA for MS
Word 2000:

Set oApp = New Word.Application

With oApp.Dialogs(wdDialogFilePageSetup)
.Default = -1
.Execute
End With

At .Execute following error message is encountered.
"the measurement must be between 0" and 22"

No where on the web I could find cause for this error.

Thanks in advance
SRV
New York
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Cindy M -WordMVP-
 
Posts: n/a
Default Error in MS Word VBA for pagesetup Dialog

Hi ?B?U1JW?=,

Please Help me in finding cause for an error in following code in VBA for MS
Word 2000:

Set oApp = New Word.Application

With oApp.Dialogs(wdDialogFilePageSetup)
.Default = -1
.Execute
End With

At .Execute following error message is encountered.
"the measurement must be between 0" and 22"

Note: It's better to ask for VBA help in a Word programming group; this group
is mainly frequented by end-users.

The error message you quote is an error in the Word UI, not a VBA error. It's
crops up when a margin setting conflicts with what the current printer driver
tells Word is acceptable. It can also be caused by "other things", such as a
damaged file. What are you trying to achieve with this code?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :-)

  #3   Report Post  
Posted to microsoft.public.word.docmanagement
SRV
 
Posts: n/a
Default Error in MS Word VBA for pagesetup Dialog

Thanks Cindy for you suggestion.!
I was trying to set the default page setup(that of normal template) using
that piece of code so that my application do not go cranky with different
formats for mail merging documents.

Interesting thing is the original document which gives error from this code
do not
give any error when I try from File- Page Setup - Default button. My code
should be doing the same.

-SRV
"Cindy M -WordMVP-" wrote:

Hi ?B?U1JW?=,

Please Help me in finding cause for an error in following code in VBA for MS
Word 2000:

Set oApp = New Word.Application

With oApp.Dialogs(wdDialogFilePageSetup)
.Default = -1
.Execute
End With

At .Execute following error message is encountered.
"the measurement must be between 0" and 22"

Note: It's better to ask for VBA help in a Word programming group; this group
is mainly frequented by end-users.

The error message you quote is an error in the Word UI, not a VBA error. It's
crops up when a margin setting conflicts with what the current printer driver
tells Word is acceptable. It can also be caused by "other things", such as a
damaged file. What are you trying to achieve with this code?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :-)


  #4   Report Post  
Posted to microsoft.public.word.docmanagement
Cindy M -WordMVP-
 
Posts: n/a
Default Error in MS Word VBA for pagesetup Dialog

Hi ?B?U1JW?=,

I was trying to set the default page setup(that of normal template) using
that piece of code so that my application do not go cranky with different
formats for mail merging documents.

Interesting thing is the original document which gives error from this code
do not
give any error when I try from File- Page Setup - Default button. My code
should be doing the same.

Mmmm. It goes against my grain to "fiddle" with the settings in the user's
Normal.dot. Normal.dot really belongs to the user, not the developer...

Can you explain in a bit more detail how your "mail merge application" is
supposed to function, as far as interfacing with the user goes? Any reason,
for example, you wouldn't use a template specific to the project, or just
change the page settings for any document used by your application?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)

Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Word 97 in Windows XP to maintain formatting Charlie''s Word VBA questions Microsoft Word Help 22 May 20th 23 08:51 PM
Word should allow to 'divide' page by 3 or 4, not just 2 CandasK Page Layout 2 February 28th 06 10:16 PM
How can Word display full path of a file in the title bar? SAsif Microsoft Word Help 1 January 26th 06 04:32 PM
Does Word have a QuickCorrect/Quick Word option like WordPerfect? CW New Users 2 December 20th 05 05:54 PM
In Word, how do I surpress headers and footers on page 2 Bill Microsoft Word Help 1 December 15th 05 06:13 PM


All times are GMT +1. The time now is 03:05 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"