Word mailing labels - CreateNewDocument creates labels with wrong page size and margins
- From: "danielkim" <danielkim@xxxxxxxxxxxxxxxxx>
- Date: Wed, 11 Apr 2007 20:02:54 -0700
Hello,
I am trying to automate Word (needs to be downward compatible to Word 2000, so I'm using msword9.olb library) to do a mail merge to mailing labels.
I'm using VC++, but I've also tried this with VB, and the same problem occurs.
I have directly put in the code found in article 258512, and the same problem occurs... so this should be easy to reproduce.
The problem is this:
When I create the mailing labels using automation, it creates a gigantic page of 11.22" x 12.05" size. The margins are all wrong, too.
I am trying to create a standard Avery 5160 label, and I pass in the code:
oNewDoc = oMLabel.CreateNewDocument( COleVariant( "5160"), vtOptional, vtOptional, vtOptional, vtOptional);
And what I get in the end is a large page full of labels 4 across and 12 down. I tried to change the page size directly, but the labels is still 4 across and 12 down, which means it's not really Avery 5160.
I tried the equivalent in VB using Word 2007 type library, and I got the same result.
My data source is a comma-delimited text file, but that shouldn't matter... the merging is fine. It's just that the page size and the margins are all wrong.
If you have any idea what is going on, and what I can do to fix it, I would appreciate it very much.
Thank you.
--Daniel
.
- Follow-Ups:
- Prev by Date: Re: Alerts Problem
- Next by Date: Re: Library references
- Previous by thread: Re: Alerts Problem
- Next by thread: Re: Word mailing labels - CreateNewDocument creates labels with wrong page size and margins
- Index(es):
Relevant Pages
|