Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB to Insert files with different Page Formats into one document

Status
Not open for further replies.

Etherington

Programmer
Jul 28, 2003
5
CA
Hello,

I have an existing template document requiring a 4" x 6" page format. A macro runs within the Word document with User prompts to format tables, titles, etc. to suit the 4" x 6" format.

At the end of the code, I would like to import a new file as the first sheet in the document, but it requires an 8.5" x 11" format. I can't seem to import it in it's native file layout.

Any ideas? Thanks.
 
Skip,

I've actually "inherited" the programming from a co-worker who's on maternity leave, so most of the VBA is foreign to me. Typically, I deal with Microsoft Access, and I am not too familiar with Excel and Word.

Here's the lowdown:
The original macro is in an Excel spreadsheet that exports the information layed out there into a series of word table formats as a first step. When the word document is prompted to open via the macro, the information is automatically formatted, and there are some Message Box prompts to fill in user information.

Rather than reprogramming everything, I figure that the "quick fix" was to just append the secondary Word document to the start of the document in a proper 8.5" x 11" format. In addition, there is another layout that I can apply the same code too, if I can get it to work.

Please advise.
 
My suggestion stands. Separate the rest of the document from the target import point with a section page break. Page-setup only that section with the new page parameters and then import the data. Use the macro record feature to get the gist of what needs to happen. Then the code will have to be modified to make it general.

Post your results and any other code that might be germane.

:)

Skip,
Skip@TheOfficeExperts.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top