Creating Word Documents - Win XP and WIn8 - windows-8

I build a function that creates a loooong word document (700pages++) then I Export it to .pdf.
This WinXP is a VirtualMachine
It works fine when I'm debbugin/running in WinXP. Also it's really FAST, like 3minuts.
But When I try the same code with Win8, the Formatation get a little messed up, also the time... IT gets more than 15minuts to accomplish the operation.
Why does it have this different with the same source code but only different SO ?

Related

Compiled Access Program Runs Fine on 7 Computers but Crashes on 3 others

I have written a rather complex application in Microsoft Access. It is split into front end and back end files. To protect my code, I have compiled it and saved it as a runtime .accde file, which I then changed to an .accdr file to ensure it operated as a runtime. I have created two versions of the application: one for those with 32-bit Office installed and one for those with 64-bit office. I have used Inno Setup to package the application, the data file, and other files such as the icon file, the license file, etc., into an installable package, which works just fine.
Among my team of 27 beta testers of this application, so far 6 have downloaded it, and I have tested it on four of my own computers. On seven of these computers, the installation works perfectly and the application runs with no problems.
On the computers of three of my testers, when they try to run it, they get this error message:
The expression On Open you entered as the event property setting produced the following error: Bad file name or number.
* The expression may not result in the name of a macro, the name of a user-defined function, or [Event Procedure].
I'm pretty sure I know where the code is that's causing the problem, but cannot for the life of me figure out why the application crashes on those 2 computers but not on others.
The On Open event I suspect of causing the problem checks the linked tables, gets their connect string, then looks at the path for that string for the back end database. If it does not find it there, the procedure pops up a file selector dialog and instructs the user to find the data file, then it relinks all the tables.
If anyone could point me in the right direction to fixing this problem, I would be extremely grateful.
This is typically caused by a reference labelled as MISSING.
You have two (three) options:
Run the application on the offending machines with a full version of Access that lets you debug the code
Create a small test application that lists and verifies the references you use, and run this on the offending machines
Remove those two customers
Thanks to all the contributors here. Because of these folks and additional online research, the latest answer I can find is this:
This error occurs on a small percentage of computers on which the app is installed, and no one has yet figured out why, what causes it, or how to fix it. The workaround is to install the 2013 version of the Access runtime, as later versions will still cause the problem.
At least one of the offending computers is running the Click-to-Run version of Office. Still gathering information, but that's the status as of now.

MS Access crashes every time I use Immediate Window

Every time I use the MS Access Immediate Window within the VBA Editor, Access crashes if I type any procedure name followed by the spacebar.
For example, I have a procedure called "CreateCEUploadFile" which takes a string parameter for a year. So, I'd like to type "CreateCEUploadFile "2019". However, as soon as I hit the spacebar after the e of File, Access freezes for a second, then crashes.
I initially thought this was specific to a database I've created. This is a database which was initially created 7 years ago, and has been worked on steadily over that time. So, I tried:
Compiling, then compacting and repairing. No change.
Decompiling the file. No change.
Re-compiling the file. No change
Creating a new database file, importing all objects. No change.
Restarting the PC. No change.
Removing Office (Office 365 Pro), restarting the PC, re-installing Office, re-starting the PC. No change.
I've now experimented, and discovered that the same issue occurs in all database files on this PC (a laptop that I've been using without issues for around 2 years). It also occurs with any call to any function (whether my own or built in), as soon as I hit a character after the function name.
In the immediate window:
? now --> works
? date --> works
? format( --> crashes as soon as I hit the spacebar`
I have now just discovered that this same issue occurs in MS Excel's VBA Immediate Window too...
Okay, so I've just found the solution.
Using the old principle of "What's changed since I last got this to work" I discovered that it seems to be a problem with my installation of Dextop.
I wanted to have a way of having multiple virtual desktops, and the built-in virtual desktops system in Windows 10 wouldn't cut it. Every time I do anything in SSMS on one desktop, it's reflected in the other.
So, I had a look around and found good reviews for Dextop. It seemed to work well - I have two different databases open in Access (one on each Desktop), and two different instances of SSMS, one pointing at each server. However, it seems to be this that was causing the Immediate Window to crash the relevant application.
Exit Dextop - all works well.
Restart Dextop - symptom immediately re-appears.
So now to try to find another alternative to Dextop....

Can't run different vb.net applications based on the same original app

I have a desktop Windows Forms application I built.
As we try out improvements to the program, I make the changes on a test version of the application, which connects to a test copy of the Microsoft SQL database on the back end.
Basically, to start out, I just copied the program to a different directory, re-named the assembly, created a different PublicTokenKey and used that.
The problem is when I try to run a the test copy and the live copy at the same time. It pretty clearly thinks they are the same program (when I click on the second one, the "busy" circle simple turns for a second, then the already-opened icon in the taksbar gets highlighted), even though they show up in the Task Manager as differently named applications.
What do I need to tweak in Visual Studio so Windows 10 will recognize them as different, separate programs?

Office server automation failed while calling "CopyPicture" on some computers

We have wrote an application with C++/Qt which reads some data from multiple excel files and then generate a word report. We have used benefits of Office automation server to read/find and copy data from excel files and write them into a single word file.
The application works fine without any significant problem in my office computers. Yesterday I've decided to copy the app into my laptop which has same OS and office version. After running the app, it seems that somethings wrong my OS/Office. None of the data are copied into word file. After debugging I've figured out that the app actually can read/write office files but failed to call CopyPicture method of automation!!!
I wanted to copy the range as picture, so I have used "CopyPicture" method. but it seems that the vba fails to call copyPicture on my laptop.
I'll be very appreciated for any hints. Thank you
I've found the problem and it's with excel docs which are used to copy data from. In these files, there are some embeddedCharts. after removing these charts the code works fine!!!! (very odd). Anyway, I've tried to make excel file visible in order to see if the operation goes well or not. After running (with embeddedCharts) the code worked fine (more odd!!)
excel->dynamicCall("Visible", true );
I don't know the reason but with making excel file visible, the error with copyPicture is gone!

What are my options to print an email to TIFF from Outlook via an addin?

We have a process at our company that processes TIFF images. I have a project where I want to be able to capture emails that people have received and let them pass it on to our imaging process. Right now forwarding an email isn't really an option but our initial thought was that we could create an Outlook addin that would create and send an image of the email to our internal webservice and it would just work.
I'm developing on Windows 7 with VS2010 and Outlook 2007.
I have the basic addin framework setup - that seems to work OK. The addin is there, popping a regular Windows form where I can do my stuff. But now I'm running into problems. First I was going leverage the built-in Microsoft Office Document Image Writer which can write to TIFFs. However, this doesn't appear to be installed as part of Office 2007 on Windows 7. Then I found some references that it didn't work on Win7 64bit in the first place, and that Microsoft was phasing it out in favor of their XPS printer anyway.
Then I moved on to thinking I could maybe use PDFCreator. This sort of works, except it looks like I have to actually have PDFCreator installed on the client machine, too. I was really hoping I could just bundle the dll and PDFCreator could natively "print", but it seems rely on you setting the active printer to "PDFCreator" and still printing to that. I was already maybe going to run into problems pushing a custom addin out to users in the first place; I don't know if I could get a new printer rolled out as a requirement, too.
On top of that, you apparently can't set the active/default printer in Outlook once it's running. So my plan to run the addin, change the default printer to PDFCreator, print it, then change it back isn't going to work after all anyway.
We really wanted to be able to capture emails as if the user had printed them out and scanned them, which is what they have to do now. I would really not like to rely on copying/pasting into another application if I can help with it.
Sooooooo, what other options might I have? Is there any close to native functionality in Windows or Office that would let me print to something and eventually get a TIFF? Does it look like I'm going to have to try and string together a bunch of 3rd party tools or something? It looks like the only way to "print" an email is to do the MailItem.PrintOut() command, which is just going to go to whatever the current default printer is. Are there any other TIFF-printing things available that wouldn't involve installing a new virtual printer on the end user's machine? Any other ideas? Thanks for any help!
Although you ruled it out at the start of the question...
Assuming you need those tiffs at a central location and not at the employee desktop.... I'd still advise you to have your addin forward the respective mail to a central location (as an attachment to a automated mail, or perhaps just write it to a queue folder on some network location), then have a central process pick it up and print it out to tiff files.
Unless you have exact control over the client machines at your company (which from the sound of it, you don't), you really want to move some fickle as 'switching printers in Outlook' away from the clients.
That doesn't mean this approach doesn't require hacks as well, because that central process will be running outlook to do the work.
I assume it is important that your tiffs look like they were actually printed from Outlook, if not please add that as extra information to your question, as it opens new routes. Like capturing the email-screen rendering and putting that inside a tiff file, which can all be done on any desktop machine.