keronbean.blogg.se

Insert dot leaders in word 2016
Insert dot leaders in word 2016










insert dot leaders in word 2016

What, EXACTLY, is the connection between them.if any? The first thing (logically speaking) is: are checkbox1 and checkbox2 mutually exclusive, or not?Ĭan you have checkbox1 = True, and checkbox2 = True?Ĭan you have checkbox1 = True, and checkbox2 = False?ĭoes checkbox1 = True make checkbox2 = False?ĭoes checkbox1 = True make checkbox2 = True? So.now what? Well, this is - again - just logic. So.if this is what you need, then you can not use For Each. BTW: as you posted, ws 3 seems to go to TWO places?įor Each means every one, all of them. You have no logic here for ws 1, 2, 3, and different logic for ws 3, 4, 5. However, in any case (whether they are open or you have to open them), I would make each doc a Document object. WdDoc.Bookmarks("ExcelHere" & j).Range.Pasteįirst of all, are these two different docs open? Or do you have to open them? Set wdDoc = (Template:="c:\Temp\FromExcel.dot") There are no page breaks needed as they are already in the Word template.Sub CopyWorksheetsToWord3() VERY important.Įxcel Sheet1 (I did not bother renaming the worksheets as that is not relevant) will be pasted at bookmark ExcelHere1, Sheet2 at ExcelHere2, and Sheet3 at ExcelHere3. they match the fact there are three bookmarks in the Word template.

insert dot leaders in word 2016

The Excel file has three worksheets - i.e.

insert dot leaders in word 2016

That template has three bookmarks ExcelHere1, ExcelHere2, ExcelHere3. It clones a new Word document from a Word template (c:\temp\fromexcel.dot).

INSERT DOT LEADERS IN WORD 2016 CODE

Please use the underscore character to make code fit in the code window here. What exactly are you trying to do? You could use Word bookmarks, you just have to use them properly, and some people - and ahem we know who they are.just kidding - take a little getting used to the Word Object Model, which is admittedly sometimes wonky from an Excel perspective. I used Documents.Add rather than your specific file.Įssentially, your code works OK. ' in the VBE select Tools, References and check You can use a Word Range for this, to be cleaner, like this:Sub CopyWorksheetsToWord2() You mention specific locations, but your code seems to inserting the worksheets at the end of the document. If Not ws.Name = Worksheets(Worksheets.Count).Name Then ' insert page break after all worksheets except the last one WdDoc.Paragraphs().Range.InsertParagraphAfter Ws.UsedRange.Copy ' or edit to the range you want to copy Set wdDoc = (Filename:="C:\Documents and Settings\jrose\Desktop\KCA-Testing.doc")Īpplication.StatusBar = "Copying data from " & ws.Name & "." ' in the VBE select Tools, References and check the Microsoft Word X.X object libraryĭim wdApp As Word.Application, wdDoc As Word.Document, ws As WorksheetĪpplication.StatusBar = "Creating new document." ' requires a reference to the Word Object library:












Insert dot leaders in word 2016