473,398 Members | 2,389 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Printing help

cj2
I need to create a cover letter in VB. It will have a customers account
number at the top and be addressed to them by name for example (Dear Mr.
Smith). After this it will be the same text for each customer.

This letter is a reminder to pay an invoice and it needs to be merged in
front of an existing pdf document which is the unpaid invoice the
customer was sent previously. The result of the merger of this reminder
letter and the unpaid invoice will be a pdf file that is sent on cd to a
company that does our actual printing and mailing for us.

So again it goes like this
new letter + existing pdf = new pdf which consists of the letter as the
first page followed by 1 or more pages that were part of the old pdf.

One more caveat, the cover letter needs a small line about one inch long
printed on it about 3/4 of an inch down along the right side of the
page. This is a mark used by the folding and stuffing equipment to know
where one mailing is finished and another starts.

It's been suggested I can somehow get VB to use word to do this. I can
easily create a template letter in using Word and even include the
needed line I think if VB can feed it the account number and name. How
do I do this? How do I handle the merging of the documents? Is this
possible? Can anyone point me to any help?

Thanks,
CJ
Jul 25 '08 #1
6 1796
try this a very good work on pdf but it is in french

http://www.vbfrance.com/codes/OPENPDF-NET_46727.aspx

if this do not feed your needs search "SharpPDF"

"cj2" <cj*@nospam.nospamwrote in message
news:eW**************@TK2MSFTNGP03.phx.gbl...
I need to create a cover letter in VB. It will have a customers account
number at the top and be addressed to them by name for example (Dear Mr.
Smith). After this it will be the same text for each customer.

This letter is a reminder to pay an invoice and it needs to be merged in
front of an existing pdf document which is the unpaid invoice the customer
was sent previously. The result of the merger of this reminder letter and
the unpaid invoice will be a pdf file that is sent on cd to a company that
does our actual printing and mailing for us.

So again it goes like this
new letter + existing pdf = new pdf which consists of the letter as the
first page followed by 1 or more pages that were part of the old pdf.

One more caveat, the cover letter needs a small line about one inch long
printed on it about 3/4 of an inch down along the right side of the page.
This is a mark used by the folding and stuffing equipment to know where
one mailing is finished and another starts.

It's been suggested I can somehow get VB to use word to do this. I can
easily create a template letter in using Word and even include the needed
line I think if VB can feed it the account number and name. How do I do
this? How do I handle the merging of the documents? Is this possible?
Can anyone point me to any help?

Thanks,
CJ
Jul 26 '08 #2
Hello CJ,

If the program is required to be designed as new letter + existing pdf =
new pdf, we need to turn to some third party libraries or open source
components (e.g. Gillard's links) for help because Microsoft does not have
component to read&edit an existing pdf file.

But if the program can be designed as new letter + existing doc(x) template
= new pdf, we can implement it with VB.NET + Microsoft Word 2007 (note:
Microsoft Word 2003 and the previous do not have the function in its object
model to export a document to pdf. This feature is new to Word 2007). Here
is a step list of implementation for your reference.

Step1. Create a Word document with a bookmark "DearTitle" in the first
line, followed by the same text for each customer.

Step2. Regarding your request of a small line along the right side of the
page, I think we can place a Word line shape at the right position, and set
is Text Wrapping to "In front of text" so that the line has a fixed
position and does not interfere with the document body.

Step3. Save the document as a Word template (dotx)

Step4. Create a new VB.NET project in Visual Studio, prepare for Word
automation, and write code to create a new document based on the dotx in
step3.
http://support.microsoft.com/kb/316383/en-us
oWord.Documents.Add "<Path to your template>\MyTemplate.dot"

Step5. Automate Word to set the bookmark "DearTitle"'s text as customers'
name ("Dear Mr. Smith")
http://support.microsoft.com/kb/316383/en-us
oDoc.Bookmarks.Item("DearTitle").Range.Text = "Dear Mr. Smith"

Step6. Export the document to pdf
oDoc.ExportAsFixedFormat("d:\result.pdf",
Word.WdExportFormat.wdExportFormatPDF)

CJ, please let me know whether this step list is helpful to you or not. If
you have any other questions or concerns, DON'T hesitate to tell me.

Regards,
Jialiang Ge (ji****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 28 '08 #3
cj2
I've been put on another project for a few day. You understand
correctly what I wanted to do. I have a third-party com component that
will append a pdf to another pdf so I can use that. We had hoped to
avoid using it. Still a co-worker insists that Word will do this. When
I get back on this project (probably next week) I'll insist he prove it
to me.

Jialiang Ge [MSFT] wrote:
Hello CJ,

If the program is required to be designed as new letter + existing pdf =
new pdf, we need to turn to some third party libraries or open source
components (e.g. Gillard's links) for help because Microsoft does not have
component to read&edit an existing pdf file.

But if the program can be designed as new letter + existing doc(x) template
= new pdf, we can implement it with VB.NET + Microsoft Word 2007 (note:
Microsoft Word 2003 and the previous do not have the function in its object
model to export a document to pdf. This feature is new to Word 2007). Here
is a step list of implementation for your reference.

Step1. Create a Word document with a bookmark "DearTitle" in the first
line, followed by the same text for each customer.

Step2. Regarding your request of a small line along the right side of the
page, I think we can place a Word line shape at the right position, and set
is Text Wrapping to "In front of text" so that the line has a fixed
position and does not interfere with the document body.

Step3. Save the document as a Word template (dotx)

Step4. Create a new VB.NET project in Visual Studio, prepare for Word
automation, and write code to create a new document based on the dotx in
step3.
http://support.microsoft.com/kb/316383/en-us
oWord.Documents.Add "<Path to your template>\MyTemplate.dot"

Step5. Automate Word to set the bookmark "DearTitle"'s text as customers'
name ("Dear Mr. Smith")
http://support.microsoft.com/kb/316383/en-us
oDoc.Bookmarks.Item("DearTitle").Range.Text = "Dear Mr. Smith"

Step6. Export the document to pdf
oDoc.ExportAsFixedFormat("d:\result.pdf",
Word.WdExportFormat.wdExportFormatPDF)

CJ, please let me know whether this step list is helpful to you or not. If
you have any other questions or concerns, DON'T hesitate to tell me.

Regards,
Jialiang Ge (ji****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Jul 31 '08 #4
cj2
Hi Jialiang Ge,

I have finally started back to work on this project. As you suggested I
am using a template for the letter and can fill it using VB to create
each customers letter.

For attaching a copy of the customers last invoice. I decided to try
this in Word w/o using VB to see if it is possible first. I don't need
to edit the invoice--just attach it. With the template letter opened in
word I went to the bottom and put a hard return to get me at the top of
page 2. I went to insert/object/Adobe Acrobat Document then pointed it
to an invoice. It did put the invoice into the word document on page 2
and I can save this combined document as a pdf. This is technically
what I want to do using VB. However the problem I found was when the
pdf was inserted into the word document it shows much smaller than it
really is. If I right click the inserted pdf invoice it in word and
choose Format Object/Size it reports it as 8.25" high and 6.38" wide.
If I open pdf invoice in adobe and check in the print properties it
shows it as 11" high and 8.5" wide. I can't seem to get word to insert
it at the same size/resolution as it is viewed and printed using Adobe.
If I try to stretch it in word it gets very blurry. Do you have any
idea how to insert it and have it remain full size. If I can get this
figured out I'm sure I can automate it in VB.

Thanks for your help.
CJ

Jialiang Ge [MSFT] wrote:
Hello CJ,

If the program is required to be designed as new letter + existing pdf =
new pdf, we need to turn to some third party libraries or open source
components (e.g. Gillard's links) for help because Microsoft does not have
component to read&edit an existing pdf file.

But if the program can be designed as new letter + existing doc(x) template
= new pdf, we can implement it with VB.NET + Microsoft Word 2007 (note:
Microsoft Word 2003 and the previous do not have the function in its object
model to export a document to pdf. This feature is new to Word 2007). Here
is a step list of implementation for your reference.

Step1. Create a Word document with a bookmark "DearTitle" in the first
line, followed by the same text for each customer.

Step2. Regarding your request of a small line along the right side of the
page, I think we can place a Word line shape at the right position, and set
is Text Wrapping to "In front of text" so that the line has a fixed
position and does not interfere with the document body.

Step3. Save the document as a Word template (dotx)

Step4. Create a new VB.NET project in Visual Studio, prepare for Word
automation, and write code to create a new document based on the dotx in
step3.
http://support.microsoft.com/kb/316383/en-us
oWord.Documents.Add "<Path to your template>\MyTemplate.dot"

Step5. Automate Word to set the bookmark "DearTitle"'s text as customers'
name ("Dear Mr. Smith")
http://support.microsoft.com/kb/316383/en-us
oDoc.Bookmarks.Item("DearTitle").Range.Text = "Dear Mr. Smith"

Step6. Export the document to pdf
oDoc.ExportAsFixedFormat("d:\result.pdf",
Word.WdExportFormat.wdExportFormatPDF)

CJ, please let me know whether this step list is helpful to you or not. If
you have any other questions or concerns, DON'T hesitate to tell me.

Regards,
Jialiang Ge (ji****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Aug 7 '08 #5
cj2
:( I just found out it's only inserting the first page of the invoice
pdf. My invoice pdfs many times have 2 or 3 pages. I guess I'll need
that figured out too.

Maybe I'll have to return to a 3rd party control to append the invoice
to the collections letter after all.

Any ideas?

cj2 wrote:
Hi Jialiang Ge,

I have finally started back to work on this project. As you suggested I
am using a template for the letter and can fill it using VB to create
each customers letter.

For attaching a copy of the customers last invoice. I decided to try
this in Word w/o using VB to see if it is possible first. I don't need
to edit the invoice--just attach it. With the template letter opened in
word I went to the bottom and put a hard return to get me at the top of
page 2. I went to insert/object/Adobe Acrobat Document then pointed it
to an invoice. It did put the invoice into the word document on page 2
and I can save this combined document as a pdf. This is technically
what I want to do using VB. However the problem I found was when the
pdf was inserted into the word document it shows much smaller than it
really is. If I right click the inserted pdf invoice it in word and
choose Format Object/Size it reports it as 8.25" high and 6.38" wide. If
I open pdf invoice in adobe and check in the print properties it shows
it as 11" high and 8.5" wide. I can't seem to get word to insert it at
the same size/resolution as it is viewed and printed using Adobe. If I
try to stretch it in word it gets very blurry. Do you have any idea how
to insert it and have it remain full size. If I can get this figured
out I'm sure I can automate it in VB.

Thanks for your help.
CJ

Jialiang Ge [MSFT] wrote:
>Hello CJ,

If the program is required to be designed as new letter + existing pdf
= new pdf, we need to turn to some third party libraries or open
source components (e.g. Gillard's links) for help because Microsoft
does not have component to read&edit an existing pdf file.

But if the program can be designed as new letter + existing doc(x)
template = new pdf, we can implement it with VB.NET + Microsoft Word
2007 (note: Microsoft Word 2003 and the previous do not have the
function in its object model to export a document to pdf. This feature
is new to Word 2007). Here is a step list of implementation for your
reference.

Step1. Create a Word document with a bookmark "DearTitle" in the first
line, followed by the same text for each customer.

Step2. Regarding your request of a small line along the right side of
the page, I think we can place a Word line shape at the right
position, and set is Text Wrapping to "In front of text" so that the
line has a fixed position and does not interfere with the document body.

Step3. Save the document as a Word template (dotx)

Step4. Create a new VB.NET project in Visual Studio, prepare for Word
automation, and write code to create a new document based on the dotx
in step3.
http://support.microsoft.com/kb/316383/en-us
oWord.Documents.Add "<Path to your template>\MyTemplate.dot"

Step5. Automate Word to set the bookmark "DearTitle"'s text as
customers' name ("Dear Mr. Smith")
http://support.microsoft.com/kb/316383/en-us
oDoc.Bookmarks.Item("DearTitle").Range.Text = "Dear Mr. Smith"

Step6. Export the document to pdf
oDoc.ExportAsFixedFormat("d:\result.pdf",
Word.WdExportFormat.wdExportFormatPDF)

CJ, please let me know whether this step list is helpful to you or
not. If you have any other questions or concerns, DON'T hesitate to
tell me.

Regards,
Jialiang Ge (ji****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments
and suggestions about how we can improve the support we provide to
you. Please feel free to let my manager know what you think of the
level of service provided. You can send feedback directly to my
manager at: ms****@microsoft.com.

================================================= =
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif

ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent
issues where an initial response from the community or a Microsoft
Support Engineer within 1 business day is acceptable. Please note that
each follow up response may take approximately 2 business days as the
support professional working with you may need further investigation
to reach the most efficient resolution. The offering is not
appropriate for situations that require urgent, real-time or
phone-based interactions or complex project analysis and dump analysis
issues. Issues of this nature are best handled working with a
dedicated Microsoft Support Engineer by contacting Microsoft Customer
Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
================================================= =
This posting is provided "AS IS" with no warranties, and confers no
rights.
Aug 7 '08 #6
Hello CJ,

The component "Adobe Acrobat Document" in the Insert/Object dialog was
designed&developed by Adobe. It inserts a PDF file as an object in Word,
but you will only see the top page by design. If a change of this behavior
is necessary, we may need to contact Adobe's support
http://www.adobe.com/support/.

Word does not have any built-in function to import the complete pdf content
to a document. There are 3rd party utilities that can separate the PDF
pages as individual graphics to be inserted into Word, but this may be not
better than your current solution -- a 3rd party control to append the
invoice.

P.S. I think I still had some misunderstanding at the beginning of this
thread. I did not assume that you have to import an existing pdf to a word
document, so I suggested automating Word.

Regards,
Jialiang Ge (ji****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

=================================================
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

This posting is provided "AS IS" with no warranties, and confers no rights.
=================================================

Aug 8 '08 #7

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

Similar topics

0
by: Programatix | last post by:
Hi, I am working on the PrintDocument, PrintDialog, PageSetupDialog and PrintPreviewControl components of Visual Studio .NET 2003. My developement machine is running Windows XP. There are...
0
by: Programatix | last post by:
Hi, I am working on the PrintDocument, PrintDialog, PageSetupDialog and PrintPreviewControl components of Visual Studio .NET 2003. My developement machine is running Windows XP. There are...
0
by: DotNetDummy | last post by:
Hi all, I am trying to set the printing setting e.g duplex mode etc. on a default printer when I.E object started printing a particular html doc. Here's the partial code, any help would be...
5
by: Stefania Scott | last post by:
I am trying to print a word document from Access. The code I've written works well in my computer but does not in the one were it is needed. Here the piece of code: 'doc path strObjectPath =...
4
by: Arif | last post by:
I C# code prints very slow as compared to a third party barcode printing software. That software prints approximately 10 labels in 2 seconds while my C# code prints 10 labels in 5 to 6 seconds. And...
0
by: Nigel | last post by:
I successfully create a .NET Component (Visual Basic .NET) that would print, unfortunately when used within a web browser it appears that .NET security doesn't allow you to run code that interacts...
2
by: Sukh | last post by:
Hi I am stuck with a problem Can anyone help me out from this... I am printing a report on pre-printed continue paper using dot-matrix printer using vb.net. Data is printing on all the...
12
by: Alex Clark | last post by:
Greetings, (.NET 2.0, WinXP Pro/Server 2003, IE6 with latest service packs). I've decided to take advantage of the layout characteristics of HTML documents to simplify my printing tasks, but...
6
by: Siv | last post by:
Hi, I am getting into printing with VB.NET 2005 and want to implement the usual capability that a user can select a selection of pages. I have a report that is generated by my application that if...
8
by: Neo Geshel | last post by:
Greetings. BACKGROUND: My sites are pure XHTML 1.1 with CSS 2.1 for markup. My pages are delivered as application/xhtml+xml for all non-MS web clients, and as text/xml for all MS web...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.