[NA] Word automation from hosted website. Impossible?

SixPapaCharlie

May the force be with you
Joined
Aug 8, 2013
Messages
16,095
Display Name

Display name:
Sixer
I'm quite bummed.
I wrote this really great code using office interop to generate word docs for my online kneeboard generator only to learn that you are not supposed to use office automation from web based code.

Honestly I'm pretty pizzed at myself for building it, assuming it would work. It was a really clean solution and the output allowed more content on a single page vs. the PDF code I have in place now. It works great on my local machine on a virtual host.

So I see there are dll files I can buy for a grand to generate doc and docx files from code but I really don't want to spend money on a pet project at this point.

Any of you have any experience doing mail merge, or word doc generation from hosted web code?

Anyway. Hoping to find a way to do this w/o spending money. I want to grab data from the database, and merge it into predefined fields in a word document and display it for printing/saving as a MS word doc.
 
I'm quite bummed.
I wrote this really great code using office interop to generate word docs for my online kneeboard generator only to learn that you are not supposed to use office automation from web based code.

Honestly I'm pretty pizzed at myself for building it, assuming it would work. It was a really clean solution and the output allowed more content on a single page vs. the PDF code I have in place now. It works great on my local machine on a virtual host.

So I see there are dll files I can buy for a grand to generate doc and docx files from code but I really don't want to spend money on a pet project at this point.

Any of you have any experience doing mail merge, or word doc generation from hosted web code?

Anyway. Hoping to find a way to do this w/o spending money. I want to grab data from the database, and merge it into predefined fields in a word document and display it for printing/saving as a MS word doc.

I played with this for a while for a prospect, but I wound up turning him away because he was a pain in the ass difficult to work with.

https://github.com/PHPOffice/PHPWord

Rich
 
I'm quite bummed.
I wrote this really great code using office interop to generate word docs for my online kneeboard generator only to learn that you are not supposed to use office automation from web based code.

Honestly I'm pretty pizzed at myself for building it, assuming it would work. It was a really clean solution and the output allowed more content on a single page vs. the PDF code I have in place now. It works great on my local machine on a virtual host.

So I see there are dll files I can buy for a grand to generate doc and docx files from code but I really don't want to spend money on a pet project at this point.

Any of you have any experience doing mail merge, or word doc generation from hosted web code?

Anyway. Hoping to find a way to do this w/o spending money. I want to grab data from the database, and merge it into predefined fields in a word document and display it for printing/saving as a MS word doc.

Was there a reason give why you shouldn't use OA? If this is just a proof of concept, even if it's flaky or insecure, wouldn't that prove the point?
 
I'm confused as to why you have to buy fancy dlls. You should be able to use php to grab the data from the database and stuff it into a docx easily enough.
 
I'm confused as to why you have to buy fancy dlls. You should be able to use php to grab the data from the database and stuff it into a docx easily enough.
I am not using PHP.
I am using ASP.NET
Historically, I have done mail merge functions on a DOT template with code behind.
Apparently this is totally frowned upon in a hosted scenario.

When researching, I got a ton of hits for sites that sell dll to do this function but $$$
The thing you and rich describe both use PHP, I am assuming doing this is language indifferent and I could do the same thing w/ vb code behind in an ASP page.

It is tough to google techniques to do this in .NET as the hits all come back w/ the dll sales sites.
 
:eek:

Shouldn't this be posted on the Information Technologists of America forum?
 
I am not using PHP.
I am using ASP.NET
Historically, I have done mail merge functions on a DOT template with code behind.
Apparently this is totally frowned upon in a hosted scenario.

When researching, I got a ton of hits for sites that sell dll to do this function but $$$
The thing you and rich describe both use PHP, I am assuming doing this is language indifferent and I could do the same thing w/ vb code behind in an ASP page.

It is tough to google techniques to do this in .NET as the hits all come back w/ the dll sales sites.
It's either native to PHP or a free extension can't remember because I have it baked into my default instance in all my apache servers.

Dotnet makes things like this very complicated.
 
That's
I am not using PHP.
I am using ASP.NET
Historically, I have done mail merge functions on a DOT template with code behind.
Apparently this is totally frowned upon in a hosted scenario.

When researching, I got a ton of hits for sites that sell dll to do this function but $$$
The thing you and rich describe both use PHP, I am assuming doing this is language indifferent and I could do the same thing w/ vb code behind in an ASP page.

It is tough to google techniques to do this in .NET as the hits all come back w/ the dll sales sites.

That's one of the reasons I use LAMP.

I suppose you can run an instance of LibreOffice on the server and do it that way. Not very efficient, though. Or maybe you can poke around in there and find the dlls you need.

Rich
 
You’re going about this in a totally ass backwards way. Why the hell would you want to couple to proprietary word files that tons of people have no means to open? There is a reason there isn’t a good way to do this. It’s a bad idea.

Just generate a damn html page that is printer friendly. That would be the easiest and most sane thing to do. You can control how a page will print with CSS.

If you really are opposed to the previous idea than generate a PDF. There are countless libraries for ASP, PHP, and every other language on this planet for generating PDFs. It IS just the format designed for this.

Nothing ****es me off more than tech people giving me things in word that should have been a pdf. If someone sends me a resume in a docx I just delete it.

I wouldn’t dare open a docx from any untrustworthy source. If a trusted partner sends me one and I really need to open it I use a virtual machine.
 
It currently does PDF but I wanted to add word as an option for those that want to edit as well.
I may research the printable HTML. I took a stab at that and lots of formatting was lost on the actual print.

I may just leave it as PDF.
 
Could ya do WordPerfect format for spike? And I’d like ascii please. And Nate wants binary I’m sure - you know how he doesn’t like gray areas.
 
Wordstar boyz... Gotta love them hats (^).

Sure Multimate Advantage was better, but so much more expensive.
 
I thought most pilots were. IT guys

Many here are. IT people know if the answer was “Microsoft Word”, the problem wasn’t understood. :)
It’s a bad idea.

See? @jesse beat me to it.

Could ya do WordPerfect format for spike? And I’d like ascii please. And Nate wants binary I’m sure - you know how he doesn’t like gray areas.

EBCDIC and the whole thing written in REXX would be better than MS Word. :) :) :)
 
Back
Top