- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
New here but have used a lot of the info whilst learning iLogic but couldn't find what I was looking for for this one.
I'm writing something which has sent a designed name from my .ipt file to the .idw and is being used in the Title Block as the Title. However, in the .idw I would like that same title to be in the iProperties version of it. I am running into this error: The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG)), and it specifically mentions the .GetResultText line which I cannot find an alternative for (or even any real mention of it online). This code (much like most of mine) has been butchered from another user on this site I believe so credit where credit is due.
Any help would be much appreciated.
Dim oDoc As Document
Dim oSheet As Sheet
Dim oTB1 As TitleBlock
Dim titleDef As TitleBlockDefinition
Dim oPrompt As TextBox
Dim title As String
Dim titleVal As String
oDoc = ThisApplication.ActiveDocument
oSheet = oDoc.Activesheet
oTB1 = oSheet.TitleBlock
titleDef = oTB1.Definition
For Each defText As TextBox In titleDef.Sketch.TextBoxes
If defText.Text = "<TITLE>" Then
oPrompt = defText
Exit For
End If
Next
title = oTB1.GetResultText(oPrompt)
iProperties.Value("Summary", "Title") = title
Logger.Debug("Title: " & title)
Solved! Go to Solution.