Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
for some reason the below code keeps getting stuck at the goto clause
thanks for any help on this guys.
Sub ExportGraph()
Set objWord = CreateObject("Word.Application")
objWord.visible =true
objWord.Documents.open "C:\Users\samuel.brierley\Desktop\External Projects\NRA\NRA_ITS_EMC_Report_Template.docx"
Const wdOrientLandscape = 1
ActiveDocument.GetSheetObject("CH18").CopyBitmapToClipboard
GoTo What:=objWord.wdGoToBookmark, Name:="Equipment_Added"
With ActiveDocument.Bookmarks
.DefaultSorting = wdSortByName
.ShowHidden = False
End With
Selection.PasteSpecial Link:=False, DataType:=wdPasteBitmap, Placement:= _
wdInLine, DisplayAsIcon:=False
end sub
I believe that the only way to use GoTo in vbscript is with error handling:
On Error GoTo What
Within qlikview only On Error Resume Next is available.
- Marcus
That was recorded within word, the idea is to GoTo the bookmark and paste the image there
This works,
Set objWord = CreateObject("Word.Application")
objWord.visible =true
objWord.Documents.open "C:\Users\samuel.brierley\Desktop\External Projects\NRA\NRA_ITS_EMC_Report_Template.docx"
Const wdOrientLandscape = 1
ActiveDocument.GetSheetObject("CH18").CopyBitmapToClipboard
objWord.wdGoToBookmark "Equipment_Added"
With ActiveDocument.Bookmarks
.DefaultSorting = wdSortByName
.ShowHidden = False
End With
Selection.PasteSpecial Link=False, DataType=wdPasteBitmap, Placement= wdInLine, DisplayAsIcon=False
end sub