office-2007

Excel VBA for creating numbered list in Word

冷暖自知 提交于 2019-12-08 04:50:38
问题 I am trying to use VBA code in Excel to create a numbered list in a Word document. Dim wrdApp As Word.Application Dim wrdDoc As Word.Document Set wrdApp = CreateObject("Word.Application") wrdApp.Visible = True Set wrdDoc = wrdApp.Documents.Add With wrdDoc For i = 0 To 5 .Content.InsertAfter ("Paragraph " & i) .Content.InsertParagraphAfter Next .Paragraphs(1).Range.ListFormat.ApplyListTemplateWithLevel ListTemplate:= _ ListGalleries(wdNumberGallery).ListTemplates(1), ContinuePreviousList:= _

PowerPoint 2007 SP2, ExportAsFixedFormat in PowerShell?

江枫思渺然 提交于 2019-12-08 04:40:59
问题 Yesterday I was trying to batch convert a group of PPTs into PDFs for a friend, and I decided to have a look at PowerShell, since it's been sitting on my HD for a while. Here's the code I've come up with. $p = new-object -comobject powerpoint.application # I actually don't know why I have to set the window to visible, # but it doesn't work otherwise, anyway, it's not the real problem I have $p.visible = 1 $f = $p.presentations.open('\some\file.ppt') $f.ExportAsFixedFormat('\some\newfile.pdf',

PowerPoint 2007 SP2, ExportAsFixedFormat in PowerShell?

血红的双手。 提交于 2019-12-07 15:10:48
Yesterday I was trying to batch convert a group of PPTs into PDFs for a friend, and I decided to have a look at PowerShell, since it's been sitting on my HD for a while. Here's the code I've come up with. $p = new-object -comobject powerpoint.application # I actually don't know why I have to set the window to visible, # but it doesn't work otherwise, anyway, it's not the real problem I have $p.visible = 1 $f = $p.presentations.open('\some\file.ppt') $f.ExportAsFixedFormat('\some\newfile.pdf', 2) 2 is for PDF Since the "brute force" method didn't work ("type mismatch") I tried to import the

Repeating content with Office Open XML

时光怂恿深爱的人放手 提交于 2019-12-06 05:29:47
I've been checking out what is possible with the Office Open XML specification for documents. I'm particularly interested in being able to add custom XML content to a document and binding it to content controls. I was wondering if it is possible to have a repeating content control type? For example, say I have some custom XML in my .docx file that looks like so: <Work> . . <People> <Person> <Name>Jane Doe</Name> <EmailAddress>jane@abc.com</EmailAddress> </Person> <Person> <Name>John Doe</Name> <EmailAddress>john@xyz.com</EmailAddress> </Person> </People> </Work> Is there any repeating content

Best way to read an Excel file into an Access database

送分小仙女□ 提交于 2019-12-06 04:13:03
问题 What's the "best" way to read (just read) an Excel file from within an Access 2007 application. I only want to loop trough the rows and put the data into an Access table. I don't want a manually import (Get External Data dialog) but by VBA. The user gets a Form with a Browse button and then points to a Excel file with a defined content/format. After that the VBA code reads the data and puts it into the Access database. 回答1: You could try the DoCmd.TransferSpreadsheet method. DoCmd

How to add multiple recipients to mailitem.cc field c#

十年热恋 提交于 2019-12-05 01:27:55
Oki, so im working on outlook .msg templates. Opening them programmatically, inserting values base on what's in my db. ex. when i want to add multiple reciepients at "To" field, instead of doing as following, mailitem.To = a + ";" + b + ";" + c; i do whats below, which is simpler, especially when i'm doing it in a loop. mailitem.Recipients.add("a"); mailitem.Recipients.add("b"); mailitem.Recipients.add("c"); My problem is, i also want to add multiple recipients at "CC" field and the function above only works for "To" field. How can i add multiple recipients to "CC" field without having to do

How can I identify the display language (i.e. toolbars/menus) used by MS Office in Visual Basic?

我是研究僧i 提交于 2019-12-04 14:41:12
I have a macro that generates an MS Word report from an MS Excel spreadsheet. The styles I use in the report are coded in English in the Macro. Some of my team have their MS Office display language set to France (this is not weird, I work in France). My macro thus doesn't work as the style title (in English) is used to set the styles. e.g. I'm telling MS Word to use style "List Bullet 1" whereas the corresponding style in MS Word is "Liste à puce 1" so no match is found. So my question is, how can I detect the MS Office display language and then set the style value in the correct language ?

Working with Office “open” XML - just how hard is it?

ぃ、小莉子 提交于 2019-12-04 14:01:28
问题 I'm considering replacing a (very) large body of Office-automation code with something that works with the Office XML format directly. I'm just starting out, but already I'm worried that it's too big a task. I'll be dealing with Word, Excel and PowerPoint. So far I've only looked at Word and Excel. It looks like Word documents should be reasonably easy to manipulate, but Excel workbooks look like a nightmare. For example... In Word, it looks like you could delete a paragraph simply by

Best way to read an Excel file into an Access database

穿精又带淫゛_ 提交于 2019-12-04 09:51:19
What's the "best" way to read (just read) an Excel file from within an Access 2007 application. I only want to loop trough the rows and put the data into an Access table. I don't want a manually import (Get External Data dialog) but by VBA. The user gets a Form with a Browse button and then points to a Excel file with a defined content/format. After that the VBA code reads the data and puts it into the Access database. You could try the DoCmd.TransferSpreadsheet method. DoCmd.TransferSpreadsheet acImport, , "from_excel","C:\Access\demo.xls", True That imports spreadsheet data into a table

Saving multiple Word documents as HTML through Office API

陌路散爱 提交于 2019-12-03 14:43:08
问题 I have a large amount of Word documents that I need to parse. As they all were created from the same template, I think that the best approach would be to save them as HTML files and parse the HTML itself. While it's quite easy to save a single Word document as HTML, I haven't found a way to do a bulk procedure from inside Word. Thus, I'm trying to find a way to leverage the Microsoft Office/Word API to accomplish this. How can I use the Word API to save many Word documents as HTML? Thanks in