Excel / Word导出 [英] Excel/Word Export

查看:53
本文介绍了Excel / Word导出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以将数据导出到Word和Excel文档,并且一旦导出到所需的文档类型,就可以在Excel中对其进行格式化?

解决方案

< blockquote class =post_quotes>
是否可以将数据导出到Word和Excel文档,并且一旦导出到所需的文档类型,就可以在Excel中格式化它?



当您说在Excel中格式化它?时,您的意思是在相关应用程序中对其进行格式化吗??

如果是,那么是的。但是,它非常先进,需要应用程序自动化

我对Word编码知之甚少,但我想无论你使用哪个,你都可以使用代码中的剪贴板传输数据。


基本上我有一堆将由项目存储在数据库中的表单。我需要能够将这些表单导出为word或excel,以便通过电子邮件将其发送给其他人。我需要导出它们,保持它们的格式,以便另一端的人可以简单地将它们打印出来。


更具体地说,这是我想要做的,一步一步:


1)用户填写表格,点击打印,选择电子邮件作为Excel文件

2)创建Excel对象的实例。

3)格式化表单(例如设置单元格的背景颜色,更改列的宽度和行的高度,向单元格添加边框,添加基本文本,添加表格,格式化这些表格,设置对齐等等。

4)将数据库表中的信息导出到新格式化表单上的相应空格。

5)将表单保存到临时位置

6创建一个新的Outlook电子邮件实例

7)将临时文件附加到电子邮件

8)附加一个电子邮件的主题行

9)在新电子邮件中添加标准收件人列表


步骤2-4是那些我根本不知道该怎么做的人。如果所有这一切都成为可能,我只需要它背后的基本想法,我就可以弄清楚如何让它们一起工作。 (更具体地说,通过VBA在这个过程中使用了什么类/子例程和什么函数。)不幸的是,绝对必须在Access中完成所有事情。如果这是不可能的,我会一起破解,以实现它,但我不想这样做。


谢谢


(顺便说一句,那篇文章是我需要的一个良好的开端,但我需要一些更深入的东西)


我有一个教授告诉我一次 ;如果你能想到它,你可以编程。诀窍在于它取决于你想获得多么复杂。添加正确的参考文件时出口部件并不是那么困难(例如,我忘了他们是什么),但Excel格式化可能会伤害你的大脑。


是否可以将数据导出到Word和Excel文档,并且一旦导出到所需的文档类型,就可以在Excel中对其进行格式化?


Is it possible to export data to Word and Excel documents and, once it is exported to the required document type, format it from within Excel?

解决方案

Is it possible to export data to Word and Excel documents and, once it is exported to the required document type, format it from within Excel?

When you say "format it from within Excel?", do you mean "format it from within the related application?"?
If so, then yes. BUT, it is quite advanced and requires Application Automation.
I know very little about Word coding, but I imagine that whichever you''re using, you could use the clipboard in your code to transfer the data across.


Basically I have a bunch of forms that will be stored in a database by project. I need to be able to export these forms to word or excel in order to send them to other people via E-Mail. I need to export them, maintaining their formatting, though, so that the people on the other end can simply print them out.

More specifically, here is what I would like to do, step by step:

1) User fills out form, clicks print, chooses E-Mail as Excel Document
2) Create an instance of an Excel object.
3) Format the form (such as setting the background colour of cells, changing the width of columns and height of rows, adding borders to cells, adding the base text, adding tables, formatting those tables, setting alignment, et cetera).
4) Export the information from the database table to the appropriate spaces on the newly formatted form.
5) Save the form to a temporary location
6 Create a new Outlook E-Mail instance
7) Attach the temporary file to the E-Mail
8) Attach a Subject line to the E-Mail
9) Add a list of standard recipients to the new E-Mail

Steps 2-4 are the ones that I have no earthly idea how to do. If all of this is possible, I just need the basic idea behind it and I can figure out how to make it all work together. (More specifically, what classes/sub-routines and what functions are used in this process via VBA.) Unfortunately the entire thing absolutely MUST be done in Access. If this is not possible, I''ll hack something together to make it happen, but I''d prefer not to have to do that.

Thanks

(BTW, that article is a good start to what I need, but I need something perhaps a bit more in depth)


I had a prof tell me once "If you can think about it, you can program it". The trick is it depends how complex you want to get. The export parts aren''t really that difficult with the right references added and such (off hand I forget what they are) but the Excel formatting could hurt your brain.

Is it possible to export data to Word and Excel documents and, once it is exported to the required document type, format it from within Excel?


这篇关于Excel / Word导出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆