Excel or word files to PDF using VB

Question:I am looking for a tools were I can convert excel or word files to PDF I am using vb6 and wanted to know if this control was available. I am looking forward to your good news. Thx

Answer: According to your needs, maybe you can have a free trial of VeryDOC DOC to Any Converter. By this software you can convert DOC, DOCX, DOCM, RTF, TXT, PPT, PPTX, XLS, XLSX, OpenOffice ODT, HTML, MHTML files to PDF together with VB. In the following part, I will show some examples.

Step 1. Download DOC to Any Converter

  • When downloading finishes, there will be an zip file. Please unzip this file then check the elements in it.
  • Please note when you need to call this software together with VB, please download the SDK version or the server version, which is easily to be called from ASP/PHP/C#/.NET/... etc. server side applications.

Step 2. Some code examples when calling together with VB, C# and others.

Example #4 (VB.NET example),
System.Diagnostics.Process.Start("C:\doc2any.exe C:\test.doc C:\out.pdf")
Example #5 (C# example),
Please by following steps to call doc2any.exe inside a special user account,
1. Please download and install EXEShell COM Library (freeware) from following URL first,
https://www.verydoc.com/exeshell.html
https://www.verydoc.com/download/exeshell.zip
2. Please use following C# code to run the conversion inside a special user account,
~~~~~~~~~~~~~~~~~
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EXESHELLLib;

namespace ConsoleApplication1
{
    class Program
{
static void Main(string[] args)
{
EXESHELLLib.shell EXEShell = new EXESHELLLib.shellClass();
EXEShell.RunCommandLine("UserName", "Password", @"C:\doc2any.exe ""C:\test.doc"" ""C:\out.pdf""");
EXEShell = null;
}
}
}
~~~~~~~~~~~~~~~~~
Remark:
You may encounter Error 1314 in some Windows systems when you switch between user accounts, this is caused by permission setting, please refer to the steps in #2 to solve the 1314 Error.
Example #6 (PHP example),
<?php
    $exeshell =new COM("exeshell.shell") or die("Can't start exeshell");
    $exeshell->RunCommandLine("UserName", "Password", ' "C:\doc2any.exe" "C:\test.doc" "C:\out.pdf" ');
    $exeshell = null;
?>

Please note this software supports all version of VB, C#  and other third party applications. A programmer can create an application using the components provided by the Visual Basic program together with Doc to Any Converter . Programs written in Visual Basic can also use the Windows API, but doing so requires external function declarations.  If you use the SDK version of the software, when developing finishes, you are allowed to Royalty Free Runtime Desktop Distribution, which means that you can run on any number of servers/computers and distribute the newly developed software casually.  

During the using, if you have any question, please contact us as soon as possible.

VN:F [1.9.20_1166]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)

Random Posts

Leave a Reply

Your email address will not be published. Required fields are marked *


Verify Code   If you cannot see the CheckCode image,please refresh the page again!