Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I have a macro that exports images and texts to a template generated in ms word. Until a while ago it worked without problems, but it began to fail. Some instructions are not executed correctly, particularly "appWord.Selection.MoveDown wdLine, 85" since it does not advance the indicated lines (85) but a smaller amount of lines. This instruction is in other parts of the code and works perfect. Attached part of the code that does not work.
Dist_Traf_Entrada_Tit1=ActiveDocument.Variables("Dist_Traf_Entrada_Tit1").GetContent.String
ActiveDocument.GetApplication.WaitForIdle
appWord.Selection.MoveDown wdLine, 85
appWord.Selection.EndKey
appWord.Selection.TypeText Dist_Traf_Entrada_Tit1
ActiveDocument.GetApplication.Sleep 500
appWord.Selection.MoveDown wdLine, 2
appWord.Selection.EndKey
ActiveDocument.GetSheetObject("CH123").CopyBitmapToClipboard
ActiveDocument.GetApplication.WaitForIdle
appWord.Application.Selection.Paste
ActiveDocument.GetApplication.Sleep 500
Anyone who has any experience about it?, Sorry for the language but I use google translate.
Thank you
vbscript doesn't know what wdline is. Try putting a 5 in place of wdline
https://docs.microsoft.com/en-us/office/vba/api/word.wdunits
Hi, sorry for the delay. wdline is a previously defined constant, just with value 5.