Category : word

I want to make a program that detects duplicate words as in the following example: "At least one value must be entered entered in order to compute the average" We can see that "entered" is repeated and I want to find a way to detect this type of cases. archivo = str(input("Ingrese la ubicación del ..

Read more

My python code is import win32com.client as win32 import sys import pywintypes WordApp=win32.DispatchEx("Word.Application") WordApp.Visible = True doc = WordApp.Documents.Open(r’test.docx’, ReadOnly=1) WordApp.Application.Run(‘Normal.NewMacros.test1’) # no error WordApp.Application.Run(‘Normal.NewMacros.test2′,’22’)#error WordApp.Application.Run(‘Normal.NewMacros.test2′,[’22’])#error WordApp.Application.Run(‘Normal.NewMacros.test2’,22)#error WordApp.Application.Run(‘Normal.NewMacros.test2("22")’)#error WordApp.Application.Run(‘Normal.NewMacros.test2’)#error WordApp.Application.Run(‘Normal.NewMacros.test2(22))#error My vba word code is Sub test2(Var2 As String) MsgBox Var2 End Sub Error is self.oleobj.InvokeTypes(dispid, 0, wFlags, retType, argTypes, *args), … Source: Python..

Read more

I know how to add a picture into a cell of a table in a word file. The codes are shown below. import docx pic = "some_picture.jpg" document = docx.Document() tbl = document.add_table(rows=1, cols=1) row_cells = tbl.add_row().cells paragraph = row_cells[0].paragraphs[0] run = paragraph.add_run() run.add_picture(pic, width = 1400000, height = 1400000) # use add_picture function document.save("demo.docx") ..

Read more