Re: Printing help



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 (jialge@xxxxxxxxxxxxxxxxxxxx, 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: msdnmg@xxxxxxxxxxxxxx

==================================================
Get notification to my posts through email? Please refer to http://msdn.microsoft.com/subscriptions/managednewsgroups/default.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/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

.



Relevant Pages

  • Re: Printing help
    ... I have a third-party com component that will append a pdf to another pdf so I can use that. ... Microsoft Word 2003 and the previous do not have the function in its object model to export a document to pdf. ... We welcome your comments and suggestions about how we can improve the support we provide to you. ... Issues of this nature are best handled working with a dedicated Microsoft Support Engineer by contacting Microsoft Customer Support Services at http://msdn.microsoft.com/subscriptions/support/default.aspx. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Fax TIF conversion to PDF
    ... I know it's probably not going to help but asterisk offers fax to pdf then ... >> Microsoft is providing this information as a convenience to you. ... >> Microsoft CSS Online Newsgroup Support ... >> This newsgroup only focuses on SBS technical issues. ...
    (microsoft.public.windows.server.sbs)
  • Re: Master Forms/Templates Challenges
    ... guaranteed good template, ... switch over to XPS quite quickly, because it offers all the abilities of PDF ... Microsoft is a public corporation :-) It's job is to compete. ... Adobe has YEARS of head start. ...
    (microsoft.public.mac.office.word)
  • Re: Printing help
    ... If the program is required to be designed as new letter + existing pdf = ... Microsoft Word 2003 and the previous do not have the function in its object ... followed by the same text for each customer. ... Microsoft Online Community Support ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Fax TIF conversion to PDF
    ... > to convert received TIF fax file to PDF file. ... > Microsoft is providing this information as a convenience to you. ... > Microsoft CSS Online Newsgroup Support ... > This newsgroup only focuses on SBS technical issues. ...
    (microsoft.public.windows.server.sbs)

Loading